O'Reilly logo

React Native By Example by Richard Kho

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

Redux-connected TasksList component

Components in Redux will retain their JSX markup, but any logic that isn't specific to that exact component is kept by our state tree and modified through actions and reducers:

// TasksRedux/app/components/TasksList/index.js 

import React, { Component } from 'react'; 
import { 
  ListView, 
  Platform, 
  TextInput, 
  View 
} from 'react-native'; 

React Native APIs and components such as AsyncStorage have been removed from this component, since any calls to any storage methods will be handled by our actions and reducers in the future.

Create a new ListView.DataSource instance, since it is specific to this component:

 import TasksListCell from '../TasksListCell'; import styles from './styles'; export default class TasksList ...

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