Question · JavaScript and React course · Module 1: React Basics
JSX syntax rules
What is one of the key rules of JSX syntax?
Answer options
- Each component must return a single parent element (wrapper), e.g., <div> or <React.Fragment>
- JSX allows returning multiple elements without any wrapper
- In JSX you use the class attribute instead of className
- JSX does not support JavaScript expressions inside curly braces
Show the answer
Correct answer:
- Each component must return a single parent element (wrapper), e.g., <div> or <React.Fragment>