How to do it...

  1. In App.js, let's import the dependencies we'll need for our app:
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
  1. Our application only needs a render method since we're building a static layout. The rendered layout consists of a container View element and three child View elements for each colored section of the app:
export default class App extends React.Component {  render() {   return (     <View style={styles.container}>       <View style={styles.topSection}> </View>        <View style={styles.middleSection}></View>        <View style={styles.bottomSection}></View>     </View> );   }  }
  1. Next, we can begin adding our styles. The first style we'll add will be applied to the View element that wraps our entire ...

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.