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:
parent
d501713bad
commit
bbc3f603f1
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue