Reputation: 41
I am having trouble using ReactJs in a Wordpress plugin.
I am developing a Wordpress plugin using ReactJs. Googling only found ReactJs in a Wordpress theme, not plugin development.
Upvotes: 2
Views: 1111
Reputation: 41
I got it working on a plugin admin page.
Started with a working PHP-based plugin setting page. Then replaced all PHP code in the setting UI page with
<div id="content"></div>
Pre-transformed the JSX. I wasn't able to get JSX transform to work on the fly. I am not if this possible in Wordpress.
Also ran into document not ready issue. This was solved by this question.
Invariant Violation: _registerComponent(...): Target container is not a DOM element
Upvotes: 1