react-events-and-state Flashcards

1
Q

What is the purpose of state in React?

A

a data model of values that change over time, this allows us to make changes to the dom

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

define it as a prototype method in a class, bind it, then (next to the react element type) specify the event type as a prop, followed by an equals sign, followed by the handler name (of the this object) in a javscript expression

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