Skip to content

snipcart/wordpress-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tying a React SPA to WordPress as a Backend [w/ WP REST API]

react-wordpress

Every developer and their dog have something to say about WordPress, and it's not always flattering. Far from it. However, even its most avid detractors are forced to take notice of this feature, because it has already transformed the way we use the popular CMS.

WordPress Rest API is a huge step forward for frontend developers looking to combine the power of JavaScript tools like React.js with WordPress.

This is exactly what I want to do with this demo of the WordPress REST API in the work. I'll try to find out if this is really a game-changer and to deconstruct the hype surrounding it.

I'll use WordPress as a backend, and WordPress REST API to feed data into a neat React.js SPA.

Steps:

  • Creating models with the WP Advanced Custom Fields plugin.
  • Generating a custom endpoint.
  • Setting up a React single-page application.
  • Consuming the JSON REST API with React.

Read the full tutorial here

See the live demo here

Enjoy folks!