What is JSX?

Instruction: Define JSX and explain its purpose in React development.

Context: This question evaluates the candidate's familiarity with JSX syntax and its importance in simplifying the development process by allowing HTML in JavaScript.

Updated

Official answer available

Read the opening below, then unlock the full answer and practical guidance.

JSX is a JavaScript syntax extension for expressing a UI tree. It resembles HTML, but it is not a string of HTML and browsers generally need it transformed by the build tool. A transform emits JavaScript calls that create React elements, using the configured JSX runtime.

export default function Greeting({ name }) { return ( <section className="greeting"> <h2>Hello, {name}</h2> <p>Welcome back.</p> </section> ); }...

Related Questions