What is one-way data flow in React?

React basics · Freshers and experienced

Model answer

Data moves down from parent to child through props. Children cannot change a parent's data directly. When a child needs to cause a change, the parent passes down a function (a callback) and the child calls it.

This makes it easy to follow where data comes from and where it changes. It is why state is often "lifted up" to the nearest common parent.

Learn this topic

What Is React? Why Use It and How It Works in the course React.js Full Course: Beginner to Advanced.

Sign in to add your own answer.

More questions