Created
November 14, 2018 03:09
-
-
Save hpjaj/63d65a0b50fc1900b9d482e8be2fe79c to your computer and use it in GitHub Desktop.
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
| // app/javascript/packs/index.js | |
| // Run this example by adding <%= javascript_pack_tag 'hello_react' %> to the head of your layout file, | |
| // like app/views/layouts/application.html.erb. All it does is render <div>Hello React</div> at the bottom | |
| // of the page. | |
| import React from 'react' | |
| import ReactDOM from 'react-dom' | |
| import App from '../components/App' | |
| document.addEventListener('DOMContentLoaded', () => { | |
| ReactDOM.render( | |
| <App />, | |
| document.body.appendChild(document.createElement('div')), | |
| ) | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment