Closed rockiger closed 1 year ago
Possible solution? See end of article.
https://javascript.plainenglish.io/how-to-add-a-react-app-to-wordpress-pages-61aee723d607
I couldn't find anything that would help.
The approach in the article is to use WordPress's React installation, which it uses for Gutenberg and full-site editing. I can't think of a way I would hate more to develop React apps. Sorry, for being that harsh.
I think the implementation should be pretty straight forward, if I find the time or somebody else is pitching in.
We probably only need to make it possible to set more page slugs for a certain appname. The code at the moment does that:
add_option('repr_apps', [[
'appname' => $appname,
'pageslug' => $pageslug,
]]);
One solution would be to create 'more' apps or add a list of slugs. But the first approach seems more backwards compatible.
As a website maintainer, I want the React app I created in several places in my WP site, that I don't repeat myself.