From 7970b1383879ff2437dbdb5df582ca171a401c9a Mon Sep 17 00:00:00 2001 From: Website Deployment Script Date: Sat, 17 Dec 2016 02:18:48 +0000 Subject: [PATCH] Updated docs for next --- releases/next/docs/alert.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/releases/next/docs/alert.html b/releases/next/docs/alert.html index 59272fe5126..f8a977b5d78 100644 --- a/releases/next/docs/alert.html +++ b/releases/next/docs/alert.html @@ -4,7 +4,9 @@ button will be an 'OK' button.

This is an API that works both on alerts. To show an alert that prompts the user to enter some information, see AlertIOS; entering text in an alert is common on iOS only.

iOS #

On iOS you can specify any number of buttons. Each button can optionally specify a style, which is one of 'default', 'cancel' or 'destructive'.

Android #

On Android at most three buttons can be specified. Android has a concept -of a neutral, negative and a positive button:

// Works on both iOS and Android +of a neutral, negative and a positive button:

  • If you specify one button, it will be the 'positive' one (such as 'OK')
  • Two buttons mean 'negative', 'positive' (such as 'Cancel', 'OK')
  • Three buttons mean 'neutral', 'negative', 'positive' (such as 'Later', 'Cancel', 'OK')

Note that by default alerts on Android can be dismissed by clicking outside of their alert box. +To prevent this behavior, you can provide +an optional options parameter { cancelable: false } to the Alert method.

Example usage:

// Works on both iOS and Android Alert.alert( 'Alert Title', 'My Alert Msg', @@ -12,7 +14,8 @@ of a neutral, negative and a positive button:

  • If you specify one butt {text: 'Ask me later', onPress: () => console.log('Ask me later pressed')}, {text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'}, {text: 'OK', onPress: () => console.log('OK Pressed')}, - ] + ], + { cancelable: false } )

Methods #

static alert(title, message?, buttons?, options?, type?) #

You can edit the content above on GitHub and send us a pull request!

Examples #

Edit on GitHub
'use strict'; var React = require('react');