Last active
March 10, 2017 04:15
-
-
Save DennisMartinez/60b875273ea3f0aadfbac5ee35c0a4c4 to your computer and use it in GitHub Desktop.
Small react component bootstrap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react' | |
| import { render } from 'react-dom' | |
| import App from './components/App' | |
| renderReact('#root', App) | |
| function renderReact(htmlSelector, Component) { | |
| Array.from(document.querySelectorAll(htmlSelector)) | |
| .forEach(component => render(<Component {...component.dataset} />, component)) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment