A Pen by Bryan C Guner on CodePen.
Created
January 16, 2023 15:57
-
-
Save bgoonz/db79f9b772562a702642741c8e9f657d to your computer and use it in GitHub Desktop.
FC - render
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
<div id="root"> | |
<!-- This element's contents will be replaced with FunctionalComponent. --> | |
</div> |
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
/* arrow function */ | |
const FunctionalComponent = () => { | |
return <h1>Hello, world</h1>; | |
}; | |
/* regular function */ | |
/* | |
function FunctionalComponent() { | |
return <h1>Hello, world</h1>; | |
} | |
*/ | |
ReactDOM.render(<FunctionalComponent />, document.getElementById('root')); |
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
<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