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

Animating notifications

In this recipe, we will create a notification component from scratch. When showing the notification, the component will slide in from the top of the screen; after a few seconds, we will automatically hide it by sliding it out.

Getting ready

We are going to create an app called NotificationsApp. You can use any other name that you like, just make sure to use the correct name when registering the bootstrap component in step number 2.

How to do it...

  1. Let's start by creating an src folder at the root of the project, inside of this we will create a MainApp.js file and a Notification folder. Inside the Notification folder we need to create an index.js file:

  2. Open the index.ios.js and index.android.js files, remove the existing code ...

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