Add minimal example to actionsheet

Summary:
Easier to understand how to use this component. A quick example helps to beginners.
Closes https://github.com/facebook/react-native/pull/16110

Differential Revision: D6017956

Pulled By: shergin

fbshipit-source-id: 82a340dfe8551cc8d7b692b9c71237e2b4421aba
This commit is contained in:
Lukas Kurucz 2017-10-10 03:23:53 -07:00 committed by Facebook Github Bot
parent d501713bad
commit bbc3f603f1
1 changed files with 14 additions and 0 deletions

View File

@ -29,6 +29,20 @@ var ActionSheetIOS = {
*
* The 'callback' function takes one parameter, the zero-based index
* of the selected item.
*
* Minimal example:
*
* ```
* ActionSheetIOS.showActionSheetWithOptions({
* options: ['Remove', 'Cancel'],
* destructiveButtonIndex: 1,
* cancelButtonIndex: 0,
* },
* (buttonIndex) => {
* if (buttonIndex === 1) { // destructive action }
* });
* ```
*
*/
showActionSheetWithOptions(options: Object, callback: Function) {
invariant(