O'Reilly logo

React and React Native by Adam Boduch

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

Bootstrapping Relay

At this point, we have the GraphQL backend up and running. Now, we can focus on our React components in the frontend. In particular, we're going to look at Relay in a React Native context, which really only has minor differences. For example, in web apps, it's usually react-router that bootstraps Relay. In React Native, it's a little different. Let's look at the index file that serves as the entry point for our native app:

import React from 'react'; import { AppRegistry } from 'react-native'; import Relay, { DefaultNetworkLayer, RootContainer, } from 'react-relay'; import viewerQueries from './queries/ViewerQueries'; import TodoApp from './TodoApp'; // Since this is a native app instead of a web // app, we have to tell Relay ...

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