5 hands-on exercises and 5 find-the-bug challenges for the JSX Explained lesson. Every one is checked automatically in the browser — write the code, run it, and the tests tell you what still fails.
Give a paragraph a class using the JSX attribute name.
Colour a paragraph using the style prop.
Associate a label with an input using the JSX attribute name.
Render two lines separated by a line break.
Build the same element without JSX, using React.createElement.
React ignores class, so the styling never applies.
The style prop takes an object, not a CSS string.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspacefor is a reserved word, so JSX uses a different name.
DOM attributes in JSX use camelCase, not the HTML spelling.
createElement takes a tag name as a string, not an element.