Data flow Flashcards

1
Q

State is encapsulated

A

Neither parent nor child components can know if a certain component is stateful or stateless, and they shouldn’t care whether it is defined as a function or a class. This is why state is often called local or encapsulated. It is not accessible to any component other than the one that owns and sets it.

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

Top-down data flow

A

This is commonly called a “top-down” or “unidirectional” data flow. Any state is always owned by some specific component, and any data or UI derived from that state can only affect components “below” them in the tree. If you imagine a component tree as a waterfall of props, each component’s state is like an additional water source that joins it at an arbitrary point but also flows down.

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