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.

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

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.

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