Answer the question
In order to leave comments, you need to log in
Expression along with string literal (jsx)?
Greetings!
Available:
const name = "world";
const element = <h1 className={url}>Hello, world!</h1>;
ReactDOM.render(element, document.getElementById('root'));
<h1 className="class_{url}">Hello, world!</h1>
const name = "world";
const nameModified = `class_${name}`;
const element = <h1 className={url}>Hello, world!</h1>;
Answer the question
In order to leave comments, you need to log in
<h1 className={`class_${url}`}>Hello, world!</h1>
<h1 className={'class_' + url}>Hello, world!</h1>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question