snipcart / wordpress-react

A React demo app tied to a WordPress backend with REST API

Home Page:https://snipcart.com/blog/reactjs-wordpress-rest-api-example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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!

About

A React demo app tied to a WordPress backend with REST API

https://snipcart.com/blog/reactjs-wordpress-rest-api-example

License:MIT License


Languages

Language:JavaScript 67.9%Language:CSS 20.8%Language:HTML 11.3%