Why does React use className over class attribute?

class is a keyword in JavaScript.

JSX is an extension of JavaScript. That’s the reason why React uses className instead of class.

Pass a string as the className prop.