DEV Community

Discussion on: Headless WordPress with React

Collapse
 
jchiatt profile image
J.C. Hiatt

You wouldn't necessarily have to end up with two separate domains —you probably would have the API living on a subdomain of your site (api.yoursite.com).

This is pretty standard practice for decoupled applications.

Themes are just fine, but IMO your code is more portable if you are fully broken out of WordPress (just in case you change your API from WP to something else later).

Collapse
 
olivia101 profile image
Cristian

By moving to a fully decoupled approach you are losing the benefits of integrating with future third-party WordPress plugins that work with a React-based front end as well as not being able to avoid additional network requests on app initial load.

Thread Thread
 
jchiatt profile image
J.C. Hiatt

I suppose it depends on the goals of the project. Some folks would rather only use WordPress at the data source and not require any functionality from plugins (unless those plugins manipulate the data, but in that case you still wouldn't care that it's fully decoupled, because those plugins could still interact with the data within WP and never care about the frontend).