ソースを参照

Update setStackRoot’s documentation as its prototype slightly changed

Guy Carmeli 5 年 前
コミット
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 = {})