O'Reilly logo

Hands-On Design Patterns with React Native by Mateusz Grzesiukiewicz

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

Moving to a single source of truth

It's time for an exercise. Our new goal is to refactor the Tasks application so that it has a store that is a single source of truth.

To do so, we need to look for places where we rely on a component state instead of the Redux store. So far we have three views:

  • AppView.js: This has a fairly simple division into header, footer, and main content. This is a presentational component and holds no state. Its props are provided by AppContainer, which already uses the Redux store. AppView delegates main content to the following two sub-views.
  • TaskList.js: This is a presentational component responsible for displaying to-do tasks in a simple scrollable list. Its props are forwarded by AppView from AppContainer.

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