Created
March 28, 2017 05:45
-
-
Save StevenJL/2786cbabd17e14ba4af027bc63104b9e to your computer and use it in GitHub Desktop.
react/element
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
// To render a React element into a root DOM node, | |
// pass both to ReactDOM.render(): | |
const element = <h1>Hello, world</h1>; | |
ReactDOM.render( | |
element, | |
document.getElementById('root') | |
); | |
// Note that React elements are immutable and cannot | |
// be changed. The only way to change the UI is to | |
// create a new element and pass it to the ReactDOM.render() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment