Learn
When you inject JavaScript into JSX, that JavaScript is part of the same environment as the rest of the JavaScript in your file.
That means that you can access variables while inside of a JSX expression, even if those variables were declared on the outside.
// Declare a variable: const name = 'Gerdo'; // Access your variable // from inside of a JSX expression: const greeting = <p>Hello, {name}!</p>;
Instructions
1.
Replace ReactDOM.render()
‘s first argument with a JSX <h1></h1>
.
Using curly braces, set the <h1></h1>
‘s inner text equal to theBestString
.
Take this course for free
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.