Browse Source

Document registerComponent in v1-v2 migration guide

Closes #4521
Guy Carmeli 5 years ago
parent
commit
63019957c1
1 changed files with 17 additions and 0 deletions
  1. 17
    0
      docs/docs/top-level-api-migration.md

+ 17
- 0
docs/docs/top-level-api-migration.md View File

2
 
2
 
3
 In order to make our API homogenous as much as possible, we provide setRoot function that will receive layout of any kind.
3
 In order to make our API homogenous as much as possible, we provide setRoot function that will receive layout of any kind.
4
 
4
 
5
+## registerComponent
6
+Registering screens without redux or any wrapping providers is the same as in v1.
7
+```js
8
+Navigation.registerComponent('example.FirstTabScreen', () => FirstTabScreen);
9
+```
10
+
11
+### Registering screens with wrapping provider component
12
+```js
13
+Navigation.registerComponent('navigation.playground.ReduxScreen', () => (props) => (
14
+  <Provider store={reduxStore}>
15
+    <ReduxScreen {...props} />
16
+  </Provider>
17
+), () => ReduxScreen);
18
+```
19
+!>Note that `Navigation.registerComponentWithRedux` is deprecated
20
+
21
+
5
 ## startTabBasedApp(params) -> setRoot({bottomTabs})
22
 ## startTabBasedApp(params) -> setRoot({bottomTabs})
6
 
23
 
7
 ```js
24
 ```js