Get started with using React in a WordPress plugin
JavaScript PHP CSS

README.md

WP React Boilerplate

This WordPress plugin demonstrates how to setup a plugin that uses React and ES6 in a WordPress plugin.

Getting Started

  1. Make sure that you have Node.js installed.
  2. Navigate to the plugin directory, install npm dependencies, and run the dev build command:
cd /path/to/wordpress/wp-content/plugins/wp-react-boilerplate
npm install
npm run dev

Commands

npm install - Install dependencies

npm run build – Generate production versions of static assets.

npm run dev - Start webpack in "watch" mode so that the assets are automatically compiled when a file changes.

Documentation