O'Reilly logo

Developing a React Edge: The JavaScript Library for User Interfaces by The League of Extraordinary Developers

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Data Flow

In React, data flows in one direction only: From the parent to the child. This makes components really simple and predictable. They take props from the parent and render. If a prop is changed at the top level component, React will propagate that change all the way down the component tree and re-render all the components that used that property.

Components can also have internal state, which should only be modified within the component.

React components are inherently simple and you can consider them as a function that take props and state and output HTML.

In this chapter we look will look at:

  • What “props” are
  • What “state” is
  • When to use “props” and when to use “state”

Props

“props”, short for “properties" are passed to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required