Skip to content

Instantly share code, notes, and snippets.

@bgoonz
Created January 16, 2023 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bgoonz/db79f9b772562a702642741c8e9f657d to your computer and use it in GitHub Desktop.
Save bgoonz/db79f9b772562a702642741c8e9f657d to your computer and use it in GitHub Desktop.
FC - render
<div id="root">
<!-- This element's contents will be replaced with FunctionalComponent. -->
</div>
/* arrow function */
const FunctionalComponent = () => {
return <h1>Hello, world</h1>;
};
/* regular function */
/*
function FunctionalComponent() {
return <h1>Hello, world</h1>;
}
*/
ReactDOM.render(<FunctionalComponent />, document.getElementById('root'));
<script src="https://unpkg.com/react/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom/umd/react-dom.development.js"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment