Last active
March 21, 2022 17:03
-
-
Save bedirhankaradogan/259f8fbffcd7b6d591a0b987c8b82df0 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
| import React from "react"; | |
| import ReactDOM from "react-dom"; | |
| function FunctionalComponent() { | |
| return "I'm the functional component"; | |
| } | |
| const FunctionalComponentWithArrowFunction = () => { | |
| return "I'm the functional component"; | |
| } | |
| const FunctionalComponentReturnsHtml = () => { | |
| return <div>{"I'm the functional component"}</div>; | |
| } | |
| const FunctionalComponentReturnsMultilineHtml = () => { | |
| return ( | |
| <div> | |
| {"I'm the functional component"} | |
| </div> | |
| ); | |
| } | |
| const RenderFunctionalComponents = () => { | |
| return ( | |
| <div> | |
| <FunctionalComponent /> | |
| <FunctionalComponentWithArrowFunction /> | |
| <FunctionalComponentReturnsHtml /> | |
| <FunctionalComponentReturnsMultilineHtml /> | |
| </div> | |
| ); | |
| } | |
| const rootElement = document.getElementById("root"); | |
| ReactDOM.render(<RenderFunctionalComponents />, rootElement); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment