At Pangolin, we’re rather enthusiastic about React. Pangolin was our first foray into the technology, and the more we’ve learned, the more confident we’ve become that React was the right call for us. However, getting started can be tough. We decided to create a boilerplate so that you can get React into your WordPress projects as painlessly as possible. Introducing, WP Reactivate. WP Reactivate is an open source WordPress plugin boilerplate that allows you to easily create React based applications to be rendered as a shortcode, widget, or settings page. It uses Webpack to easily compile our next-generation Javascript into ES5 and bundle our modules into a single file. We’ve also allowed shortcode attributes and widget options to easily be used in your React application by using wp_localize_script to make the data available as a global object in the JS. Check out Quick Start in the README to see how this is achieved. We’ve taken care to make sure that JS assets are only loaded when the shortcode or widget is active on the page. Also included is a Settings Page endpoint where we show you how to update a setting via the default REST API Settings endpoint.
Share This