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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly