React register DOM
A simple method to mount React Component inside your website.
It's wrap ReactDOM.render
and mount your Component only if his root element is in DOM ! Perfect for website that combines HTML or template engine with a few React Component.
Usage
Install from npm:
npm i --save react-register-dom
Integrate into your app:
Javascript api
index.html
(...) (...) ... ... ... (...)
app.js
; ;;; // With DOM id -> #root-login; // With DOM id -> #root-signup; const likeButtonHTMLCollection = document; ;
Or in component file like HomeDropdown.js
;; ... ;
With HTML data attribute
index.html
(...) (...)
UserProfil.js
;; { const id username premium = thisprops; } ... ;
Pull request is welcomed ! ☕️