'How to use React for Wordpress templates without the Gutenberg editor

My current Wordpress setup uses the classic editor, ACF and Twig templates. Most of the theme is hardcoded in the templates, and only values are pulled from ACF in the editor.

Is there a way to start using React for the theme instead of Twig - without going entirely headless or switching the client facing editor to Gutenberg?

In other words, I would like to use much of Wordpress and not go headless. I do not need a block editor. But I would like to use React and possibly JSX instead of php and twig.

Wordpress has a built in interface with React - "wordpress-scripts"? Would it be possible to use this without the Gutenberg block editor?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source