How would you go about hosting / deploying a React application with WordPress on the backend? I've been using the WP Rest API plugin and that API seems to need to be hosted. Would I also have to host my front-end React application on a separate server? Or would I somehow be able to put everything onto a shared hosting service like GoDaddy or GreenGeeks?
Yes. You can use React with WordPress in cases where WordPress CMS manages React-based front-end content with the WordPress (WP) Rest Application Programming Interface (API). The WP Rest API is one of the significant WordPress features. It allows developers to build captivating themes and plugins.
Can you use React with WordPress? Yes, React can be used with WordPress, as in the example above, where the content on the front-end built with React is managed by WordPress CMS using the WP Rest API.
The first step to using WordPress as a back end is remarkably similar to starting a WordPress website. You'll need a WordPress installation loaded with all the content you want on your website or app. This could be an active installation or a new one you set up for your project.
You have a handful of options. You have the power to host React and Wordpress separately, but I prefer to host mine on the same server using docker.
If your curious, check out this starter template: https://github.com/postlight/headless-wp-starter
It's one of my favorites, and it has react pre-wrapped in a docker container with straight forward instructions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With