react-event-state Flashcards
1
Q
What is the purpose of state in React
A
It allows us to control an element so that the DOM will udpate as well.
2
Q
How do you pass an event handler to a React element?
A
Name the event using camelCase and pass the {function} rather than a string. Provide a listener when the element is initially rendered. Add it as an attribute.