Преглед изворни кода

Update setStackRoot’s documentation as its prototype slightly changed

Guy Carmeli пре 6 година
родитељ
комит
10111ccb12
1 измењених фајлова са 15 додато и 13 уклоњено
  1. 15
    13
      docs/docs/screen-api.md

+ 15
- 13
docs/docs/screen-api.md Прегледај датотеку

@@ -50,24 +50,26 @@ Navigation.popTo(componentId);
50 50
 
51 51
 ## setStackRoot(componentId, params)
52 52
 
53
-Reset the current navigation stack to a new screen component (the stack root is changed).
53
+Reset the current navigation stack to a new screen component (the stack root is changed, accepts multiple children).
54 54
 
55 55
 ```js
56
-Navigation.setStackRoot(this.props.componentId, {
57
-  component: {
58
-        name: 'example.NewRootScreen',
59
-        passProps: {
60
-          text: 'Root screen'
61
-        },
62
-        options: {
63
-          animations: {
64
-            setStackRoot: {
65
-              enabled: true
56
+Navigation.setStackRoot(this.props.componentId, [
57
+    {
58
+    component: {
59
+          name: 'example.NewRootScreen',
60
+          passProps: {
61
+            text: 'Root screen'
62
+          },
63
+          options: {
64
+            animations: {
65
+              setStackRoot: {
66
+                enabled: true
67
+              }
66 68
             }
67 69
           }
68 70
         }
69
-      }
70
-});
71
+  }
72
+]);
71 73
 ```
72 74
 
73 75
 ## showModal(layout = {})