React WP Admin plugin is a basic set up for building an admin facing page in React.js. ESbuild (a fast next-generation JavaScript bundler) has been used as a bundler.
https://wordpress.org/plugins/react-wp-admin/
-
Get a copy the of plugin, either by downloading from WordPress plugins repository or simply cloning git repository of the plugin.
-
The downloaded plugin will have
react-wp-adminfolder name. Rename it to your plugin name, also rename the filereact-wp-admin.phpto match your folder name. -
Change the plugin information (in
react-wp-admin.php) according to your needs. -
Go to
admin/reactdirectory and install dependencies by runningyarn. -
Build commands
yarn build- Production buildyarn build:dev- Development build, generates sourcemapsyarn watch- Automatically runsyarn build:devwhen files change
Do not modify anything outside src in react folder if you are not confident.