Browse Source

Update setStackRoot’s documentation as its prototype slightly changed

Guy Carmeli 6 years ago
parent
commit
10111ccb12
1 changed files with 15 additions and 13 deletions
  1. 15
    13
      docs/docs/screen-api.md

+ 15
- 13
docs/docs/screen-api.md View File

50
 
50
 
51
 ## setStackRoot(componentId, params)
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
 ```js
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
 ## showModal(layout = {})
75
 ## showModal(layout = {})