Adding styles to text and containers

We have several components at our disposal, but containers and texts are the most common and useful components to create layouts or other components. In this recipe, we will see how to use containers and text, but most importantly we will see how styles work in React Native.

We will create a UI for a simple music player; we won't be using icons for now, but we will add them later.

Getting ready

Please follow the instructions in the introduction in order to create a new app with the name ContainersText.

How to do it...

  1. Let's start by creating an src folder in the root of the project. This is where all our JavaScript code will be placed.
  2. Create a new JavaScript called MainApp.js:

  3. In the MainApp.js file, we are going ...

Get React Native Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.