React Events and State Flashcards
1
Q
What is the purpose of state in React?
A
State is an object that holes information in a component that may change.
2
Q
How to you pass an event handler to a React element?
A
By defining a method that calls setState and then passing the method as a prop.