Boilerplate for WordPress Themes using React
"I wanted to teach myself React using WordPress as a back end. Most of the React tutorials I looked at used
create-react-app
. But using that to create a WordPress theme is quite problematic due tocreate-react-app
's use of the Webpack Dev Server. Socreate-react-wptheme
uses Webpack in watch mode and your WordPress server to serve the theme (what better?).I had to write a custom Websocket server/client and a few other utilities to get feature-parity(ish) with
create-react-app
. Meaningcreate-react-wptheme
has browser launch, browser refresh and "error overlay" just likecreate-react-app
."