wp-react-boilerplate
wp-react-boilerplate copied to clipboard
add react-habitat as container-system for multi-site component support
Hey,
first of all: thanks for this boilerplate! It helped me a lot to get my head around conecting wordpress with react.
Let's come to my request: When developing a plugin it is necessary to develop different components for mutliple sites. Loading a bundled version of my react-components at start leads to some errors.
If I declared multiple components and just want to display one of them, I get an initialization-error => the other components could not be instantiated because there is no DOM-Element. So I needed to check manually if the DOM-Element exists and so on...
My conclusion: I came up with react-habitat which is like a container-system for components. You register components to this container once and can use them across multiple sites. In my opinion this would be an awsome extension to a cms-based reactive plugin.
What do you think? Is there another/better solution for this?
This might be a good idea, I just haven't had time to look into react-habitat
. The goal of this project is to act as a 'starting point' so it might make more sense to include the ability to abstract the registering of components.