- HTML and JSX may seem that they are exactly the same but there are a few differences between them.
- One of these differences is the naming convention.
- HTML attributes and event references in JSX become camelCase(onclick => onClick).
in JSX.Therefore instead of using “class” you can use “className”.
- You may want to change “class” to “className”.
Solution 1 (Click to Show/Hide)
const JSX = (
<h1>Add a class to this div</h1>