wp-react-boilerplate icon indicating copy to clipboard operation
wp-react-boilerplate copied to clipboard

add react-habitat as container-system for multi-site component support

Open walllk opened this issue 7 years ago • 1 comments

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?

walllk avatar Jul 25 '17 23:07 walllk

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.

ptasker avatar Sep 28 '17 14:09 ptasker