Quellcode durchsuchen

Document options for Peek & Pop (#4545)

Document options for Peek and Pop previews
Karl Sander vor 6 Jahren
Ursprung
Commit
ba86b3bcd8
1 geänderte Dateien mit 12 neuen und 1 gelöschten Zeilen
  1. 12
    1
      docs/docs/animations.md

+ 12
- 1
docs/docs/animations.md Datei anzeigen

@@ -49,6 +49,15 @@ const handlePress ({ reactTag }) => {
49 49
       options: {
50 50
         preview: {
51 51
           reactTag,
52
+          height: 300,
53
+          width: 300,
54
+          commit: true,
55
+          actions: [{
56
+            title: "Displayed Name",
57
+            id: "actionId",
58
+            style: 'default', /* or 'selected', 'destructive'*/
59
+            actions: [/*define a submenu of actions with the same options*/]
60
+          }]
52 61
         },
53 62
       },
54 63
     },
@@ -64,4 +73,6 @@ const Button = (
64 73
     <Text>My button</Text>
65 74
   </Navigation.TouchablePreview>
66 75
 );
67
-```
76
+```
77
+
78
+All options except for reactTag are optional. Actions trigger the same event as [navigation button presses](https://wix.github.io/react-native-navigation/#/docs/topBar-buttons?id=handling-button-press-events). To react when a preview is committed, listen to the [previewCompleted](https://wix.github.io/react-native-navigation/#/docs/events?id=previewcompleted-ios-114-only) event.