Last active
October 9, 2018 15:07
-
-
Save bedirhankaradogan/87ce4256fcf9be3f7f65a0fd67c800e9 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"; | |
| const FunctionalComponentWithProps = (props) => { | |
| const fullName = `${props.name} ${props.surname}`; | |
| const handleClick = (event) => { | |
| alert(fullName); | |
| }; | |
| return ( | |
| <div onClick={handleClick}> | |
| {`Hello ${fullName}`} | |
| </div> | |
| ); | |
| }; | |
| const RenderFunctionalComponents = () => { | |
| return <FunctionalComponentWithProps name={"Bedirhan"} surname={"Karadoğan"} />; | |
| }; | |
| 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