CodeZettaInterview Hub

React · JSX · Fresh / Intern · Concept

Why use className instead of class in JSX?

Short Interview Answer

class is a reserved word in JS; DOM property is className.

Detailed Explanation

Similarly htmlFor instead of for. React normalizes these to DOM attributes.

Did you know this answer?