In JSX syntax, I know that brace is used when writing JavaScript expressions.
const name = 'Josh Perez';
const element = <h1>Hello, {name}</h1>;
ReactDOM.render(
element,
document.getElementById('root')
);
Even if you look at the react official documentation, you do not use braces in the script as above. Since this is not JavaScript code, why not use it with {element}? Does an error occur if I use it with {element}?
You could just use
<h1>{`Hello, ${name}`}</h1>
like a javascrypt string