Created
November 25, 2019 03:13
-
-
Save react-ram/8315da25d47ec77bf82f2615da26da94 to your computer and use it in GitHub Desktop.
Basics - Introducing JSX - example 2.
This file contains 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 formatName(user) { | |
return user.first + " " + user.last; | |
} | |
const user = { | |
first: "ram", | |
last: "charan" | |
}; | |
const element = <h1>hello {formatName(user)}</h1>; | |
ReactDOM.render(element, document.getElementById("root")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment