Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/groev/wp-react-app-importer/archive/refs/heads/master.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
Publish Apps created with "Create React App" on your WordPress Site using shortcodes.
Examples
Simple: https://testend.westhofen.me/sample-page/
Advanced (Routing & Fetching): https://testend.westhofen.me/advanced-example/
Todo List with Firebase Auth: https://testend.westhofen.me/todo-example/
Guide
- Download the release from this repository
- Install the plugin in WordPress using the uploader
- Go to React Apps and create a new React App
- Upload the ZIP file of your Create-React-App build and save the post.
- Use the shortcode anywhere you like.
[React-App id="POSTID"]
Shortcode Params
- id: The ID of your application.
- stylesheet: "on" or "off", if you want to disable the react stylesheet (default: on)
Notes
- This only works with Create-React-App and is tested with the latest Version.
- You need to be careful about CSS Styling - it will apply to the whole page (Wordpress/React vice versa). JS Styling is recommended.
- Routing works with HashRouter from react-router. BrowserRouter doesn't fully work on page refresh.
- If you want to use multiple shortcodes per page, you need to change the main div from "root" to something else for each app.