...

/

What Else You Should Know

What Else You Should Know

Learn about parentheses, DOM Element API, inline styles, and comments in JSX.

Parentheses

Depending on your level of JavaScript knowledge, you may have noticed a few details. In some examples discussed previously, parentheses appear in seemingly odd places. The parentheses, ( and ), need to be wrapped around any JSX which spans more than one line — not quite so random anymore.

You can usually just put your JSX in parentheses without a problem. Many people actually prefer this practice as all JSX is uniformly treated the same way, but only multi-line JSX actually requires parentheses.

If an expression instead of a ...