Skip to content

Instantly share code, notes, and snippets.

@StevenJL
Created March 28, 2017 05:45
Show Gist options
  • Save StevenJL/2786cbabd17e14ba4af027bc63104b9e to your computer and use it in GitHub Desktop.
Save StevenJL/2786cbabd17e14ba4af027bc63104b9e to your computer and use it in GitHub Desktop.
react/element
// 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