Why React uses `className` over `class` attribute?
class
is a keyword in JavaScript, and JSX is an extension of JavaScript. That's the principal reason why React uses className
instead of class
. Pass a string as the className
prop.
render() {return <span className={'menu navigation-menu'}>{'Menu'}</span>}
February 20, 2022
1076
Read more
What is React?
November 06, 2022
ReactJSHow to programmatically trigger click event in React?
November 06, 2022
ReactJS