How to do it...

  1. Let's start by importing all the dependencies we'll need in App.js, as follows:
import React from 'react';import glamorous from 'glamorous-native';
  1. Our app will need a containing View element to hold all of the other components displayed in the app. Instead of styling this element with an object passed to the StyleSheet component, like we've been doing in all previous recipes, we'll use glamorous by passing a style object to the view method, which returns a styled View component that we store in a const called Container for later use, as follows:
const Container = glamorous.view({  flex: 1,  justifyContent: 'center',  alignItems: 'center',  backgroundColor: '#fff',});
  1. Similarly, we'll add three styled Text components using ...

Get React Native Cookbook - Second Edition 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.