DEV Community

Discussion on: How to use React inside a Wordpress application ?

Collapse
 
jamo1789 profile image
Jamo1789 • Edited

Hey, I had the same problem. You could try put and replace the wp_register_script and wp_register_style with the full path to the build index.js like this:
wp_register_script("my_react_app_js", plugins_url("/frontend/build/static/js/main.js", FILE), array(), "1.0", false);
wp_register_style("my_react_app_css", plugins_url("/frontend/build/static/css/main.css", FILE), array(), "1.0", "all"); The $path variable isn't used anywhere after that.

After replacement just try as it stated in the article.