November 2019
Beginner
804 pages
20h 1m
English
To define attributes in JSX code, you can use quotes:
const element = <div id="someDiv"></div>;
Or you can use curly braces if you need to define the value dynamically:
function getActiveClass() {
return 'active';
}
const anotherElement = <div class={getActiveClass()} />;
Read now
Unlock full access