Web / ReactJS Interview questions
What is unidirectional data flow in react?
Unidirectional data flow is a technique that is mainly found in functional reactive programming. It is also known as one-way data flow, which means the data has one, and only one way to be transferred to other parts of the application.
The major benefit of this approach is that data flows throughout your app in a single direction, giving you better control over it. In terms of React, the below scenario depicts unidirectional data flow.
- state is passed to the view and to child components.
- actions are triggered by the view.
- actions can update the state.
- the state change is passed to the view and to child components.
More Related questions...