O'Reilly logo

React Native Cookbook by Crysfel Villa, Stan Bershadskiy

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

Adding tabs to the viewport

Tabs are a very common component, especially in iOS apps. In this recipe, we will learn how to use the tabs component on iOS devices only. As of now, we don't have support for Android, and if we really want to use tabs, we would have to use a third-party library to add similar functionality.

Getting ready

We need to create an empty app using the React Native CLI. We will name it TabsComponent. Then we will create an src folder in the root of the project where we are going to define all our JavaScript code. We are going to use four different icons, but feel free to use your own or make sure to download the assets for this recipe.

How to do it...

  1. Let's start by importing all the dependencies for this component, as well as ...

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