O'Reilly logo

React and React Native by Adam Boduch

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

Getting user confirmation

In this section, you'll learn how to show modal views in order to get confirmation from the user. We'll start with the successful scenario, where an action generates a successful outcome that we want the user to be aware of. Then we'll look at the error scenario, where something went wrong and you don't want the user to move forward without acknowledging the issue.

Success confirmation

Let's start by implementing a modal view that's displayed as the result of the user successfully performing an action. Here's the Modal component that's used to show the user a success confirmation:

import React, { PropTypes } from 'react'; import { View, Text, Modal, } from 'react-native'; import styles from './styles'; // Uses "<Modal>" ...

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