Rendering todo items
It's the job of the TodoList
component to render items todo list. When AddTodoMutation
takes place, the TodoList
component needs to be able to render this new item. Relay takes care of updating the internal data stores where all of our GraphQL data lives. Here's a look at the item list again, with several more todos added:
Here's the TodoList
component itself:
import React, { PropTypes } from 'react'; import Relay from 'react-relay'; import { View } from 'react-native'; import Todo from './Todo'; // The list component itself is quite simple. Note the // property that we're using to iterate over - there's // "edges" and "nodes". ...
Get React and React Native now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.