Section 27: State Flashcards

1
Q

State

A

Data in our application that can change.

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

setState

A

*The correct way to change state in your application.

Simplest Usage: setState accepts an object with new prperties and values for this.state

this.setState({ });

**this.setState is asynchronous.

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

Pure Function

A

A function that is repeatable, so exact same inputs and outputs.

All state changes should be pure functions in React.

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

How is State passed?

A

From parent down to child component as a prop.

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