View

    Views are the most basic building block of React Native apps. The View is an abstraction layer on top of the target platform's native equivalent:

    • For iOS - UIView
    • For Android - android.view
    • For Web - <div>

    Example

    Views are primarily used for styling and layout of children elements. Let's look at a few of the styles we can apply to views. The example below contains two Views: the outer view which specifies the alignment of the content contained within, and the inner view which draws a blue square.

    Contents
    1. Example

    Want to learn React Native in-depth?

    If you like React Native Express, you'll love my new book, Fullstack React Native: The complete guide to React Native! Throughout the book, we'll build 7 full apps, covering complex topics like navigation, gestures, and native modules. We don't assume any knowledge of React or newer JavaScript language features, so you can dive right in regardless of your experience level. The book comes in PDF, EPUB and MOBI formats.

    Looking for more help?

    Infinite Red sponsors React Native Express and is the premier React Native agency. They're also the team behind the React Native newsletter, podcast, and conference listed here. Get in touch at infinite.red/react-native for a proposal on your next project!