react-events-and-state Flashcards

1
Q

What is the purpose of state in React?

A

state is a way to manage and track changes in component data over time. It is an object that holds data specific to a component and can be updated within the component, causing the component to re-render

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

you pass it as a prop to the element, just like any other data.

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