react-events-and-state Flashcards

1
Q

What is the purpose of state in React?

A

Similar to props except it allows a component to be private and have full control of the dynamic properties it contains.

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

How do you pass an event handler to a React element?

A

Pass an event handler as prop.

<button onClick={this.handleClick.bind(this)}>

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