Question

Why React's data flow, like component state flow, is called "top-down" or "unidirectional"?

#react

Answer

It's called "top-down" or "unidirectional" data flow because any state is always owned and encapsulated in one component, and any data or UI derived from that state can only affect components "below" them in the tree. This happens when the owner component passes its state down as props to its child components, ex.

<FormattedDate date={this.state.date} />

https://reactjs.org/docs/state-and-lifecycle.html#the-data-flows-down

Learn

Author

xavi

Reviews
Last
next

Students 1