|
@@ -1,188 +1,160 @@
|
1
|
1
|
# Navigation
|
2
|
2
|
|
3
|
|
-## Properties
|
|
3
|
+## Element
|
4
|
4
|
|
5
|
|
-- Element (`React.ComponentType<object>`)
|
|
5
|
+`Element (React.ComponentType<object>)`
|
6
|
6
|
|
7
|
|
-## Methods
|
|
7
|
+---
|
8
|
8
|
|
9
|
|
-### `registerComponent(componentName: string, getComponentClassFunc: ComponentProvider): void`
|
|
9
|
+## registerComponent
|
10
|
10
|
|
11
|
|
-[source](/lib/src//Navigation.ts#52)
|
|
11
|
+`registerComponent(componentName: string, getComponentClassFunc: ComponentProvider): void`
|
|
12
|
+
|
|
13
|
+[source](https://github.com/wix/react-native-navigation/blob/v2/lib/src/Navigation.ts#L52)
|
12
|
14
|
|
13
|
15
|
Every navigation component in your app must be registered with a unique name.
|
14
|
16
|
The component itself is a traditional React component extending React.Component.
|
15
|
17
|
|
16
|
|
-#### Arguments
|
17
|
|
-- componentName (`string`)
|
18
|
|
-- getComponentClassFunc (`ComponentProvider`)
|
|
18
|
+---
|
19
|
19
|
|
20
|
|
-#### Returns
|
21
|
|
-- (`void`)
|
|
20
|
+## setRoot
|
22
|
21
|
|
23
|
|
-### `setRoot(layout: any): Promise<any>`
|
|
22
|
+`setRoot(layout: any): Promise<any>`
|
24
|
23
|
|
25
|
|
-[source](/lib/src//Navigation.ts#59)
|
|
24
|
+[source](https://github.com/wix/react-native-navigation/blob/v2/lib/src/Navigation.ts#L59)
|
26
|
25
|
|
27
|
26
|
Reset the app to a new layout
|
28
|
27
|
|
29
|
|
-#### Arguments
|
30
|
|
-- layout (`any`)
|
|
28
|
+---
|
31
|
29
|
|
32
|
|
-#### Returns
|
33
|
|
-- (`Promise<any>`)
|
|
30
|
+## setDefaultOptions
|
34
|
31
|
|
35
|
|
-### `setDefaultOptions(options: any): void`
|
|
32
|
+`setDefaultOptions(options: any): void`
|
36
|
33
|
|
37
|
|
-[source](/lib/src//Navigation.ts#66)
|
|
34
|
+[source](https://github.com/wix/react-native-navigation/blob/v2/lib/src/Navigation.ts#L66)
|
38
|
35
|
|
39
|
36
|
Set default options to all screens. Useful for declaring a consistent style across the app.
|
40
|
37
|
|
41
|
|
-#### Arguments
|
42
|
|
-- options (`any`)
|
|
38
|
+---
|
43
|
39
|
|
44
|
|
-#### Returns
|
45
|
|
-- (`void`)
|
|
40
|
+## mergeOptions
|
46
|
41
|
|
47
|
|
-### `mergeOptions(componentId: string, options: any): void`
|
|
42
|
+`mergeOptions(componentId: string, options: any): void`
|
48
|
43
|
|
49
|
|
-[source](/lib/src//Navigation.ts#73)
|
|
44
|
+[source](https://github.com/wix/react-native-navigation/blob/v2/lib/src/Navigation.ts#L73)
|
50
|
45
|
|
51
|
46
|
Change a component's navigation options
|
52
|
47
|
|
53
|
|
-#### Arguments
|
54
|
|
-- componentId (`string`)
|
55
|
|
-- options (`any`)
|
|
48
|
+---
|
56
|
49
|
|
57
|
|
-#### Returns
|
58
|
|
-- (`void`)
|
|
50
|
+## showModal
|
59
|
51
|
|
60
|
|
-### `showModal(layout: any): Promise<any>`
|
|
52
|
+`showModal(layout: any): Promise<any>`
|
61
|
53
|
|
62
|
|
-[source](/lib/src//Navigation.ts#80)
|
|
54
|
+[source](https://github.com/wix/react-native-navigation/blob/v2/lib/src/Navigation.ts#L80)
|
63
|
55
|
|
64
|
56
|
Show a screen as a modal.
|
65
|
57
|
|
66
|
|
-#### Arguments
|
67
|
|
-- layout (`any`)
|
|
58
|
+---
|
68
|
59
|
|
69
|
|
-#### Returns
|
70
|
|
-- (`Promise<any>`)
|
|
60
|
+## dismissModal
|
71
|
61
|
|
72
|
|
-### `dismissModal(componentId: string): Promise<any>`
|
|
62
|
+`dismissModal(componentId: string): Promise<any>`
|
73
|
63
|
|
74
|
|
-[source](/lib/src//Navigation.ts#87)
|
|
64
|
+[source](https://github.com/wix/react-native-navigation/blob/v2/lib/src/Navigation.ts#L87)
|
75
|
65
|
|
76
|
66
|
Dismiss a modal by componentId. The dismissed modal can be anywhere in the stack.
|
77
|
67
|
|
78
|
|
-#### Arguments
|
79
|
|
-- componentId (`string`)
|
|
68
|
+---
|
80
|
69
|
|
81
|
|
-#### Returns
|
82
|
|
-- (`Promise<any>`)
|
|
70
|
+## dismissAllModals
|
83
|
71
|
|
84
|
|
-### `dismissAllModals(): Promise<any>`
|
|
72
|
+`dismissAllModals(): Promise<any>`
|
85
|
73
|
|
86
|
|
-[source](/lib/src//Navigation.ts#94)
|
|
74
|
+[source](https://github.com/wix/react-native-navigation/blob/v2/lib/src/Navigation.ts#L94)
|
87
|
75
|
|
88
|
76
|
Dismiss all Modals
|
89
|
77
|
|
90
|
|
-#### Returns
|
91
|
|
-- (`Promise<any>`)
|
|
78
|
+---
|
|
79
|
+
|
|
80
|
+## push
|
92
|
81
|
|
93
|
|
-### `push(componentId: string, layout: any): Promise<any>`
|
|
82
|
+`push(componentId: string, layout: any): Promise<any>`
|
94
|
83
|
|
95
|
|
-[source](/lib/src//Navigation.ts#101)
|
|
84
|
+[source](https://github.com/wix/react-native-navigation/blob/v2/lib/src/Navigation.ts#L101)
|
96
|
85
|
|
97
|
86
|
Push a new layout into this screen's navigation stack.
|
98
|
87
|
|
99
|
|
-#### Arguments
|
100
|
|
-- componentId (`string`)
|
101
|
|
-- layout (`any`)
|
|
88
|
+---
|
102
|
89
|
|
103
|
|
-#### Returns
|
104
|
|
-- (`Promise<any>`)
|
|
90
|
+## pop
|
105
|
91
|
|
106
|
|
-### `pop(componentId: string, params: any): Promise<any>`
|
|
92
|
+`pop(componentId: string, params: any): Promise<any>`
|
107
|
93
|
|
108
|
|
-[source](/lib/src//Navigation.ts#108)
|
|
94
|
+[source](https://github.com/wix/react-native-navigation/blob/v2/lib/src/Navigation.ts#L108)
|
109
|
95
|
|
110
|
96
|
Pop a component from the stack, regardless of it's position.
|
111
|
97
|
|
112
|
|
-#### Arguments
|
113
|
|
-- componentId (`string`)
|
114
|
|
-- params (`any`)
|
|
98
|
+---
|
115
|
99
|
|
116
|
|
-#### Returns
|
117
|
|
-- (`Promise<any>`)
|
|
100
|
+## popTo
|
118
|
101
|
|
119
|
|
-### `popTo(componentId: string): Promise<any>`
|
|
102
|
+`popTo(componentId: string): Promise<any>`
|
120
|
103
|
|
121
|
|
-[source](/lib/src//Navigation.ts#115)
|
|
104
|
+[source](https://github.com/wix/react-native-navigation/blob/v2/lib/src/Navigation.ts#L115)
|
122
|
105
|
|
123
|
106
|
Pop the stack to a given component
|
124
|
107
|
|
125
|
|
-#### Arguments
|
126
|
|
-- componentId (`string`)
|
|
108
|
+---
|
127
|
109
|
|
128
|
|
-#### Returns
|
129
|
|
-- (`Promise<any>`)
|
|
110
|
+## popToRoot
|
130
|
111
|
|
131
|
|
-### `popToRoot(componentId: string): Promise<any>`
|
|
112
|
+`popToRoot(componentId: string): Promise<any>`
|
132
|
113
|
|
133
|
|
-[source](/lib/src//Navigation.ts#122)
|
|
114
|
+[source](https://github.com/wix/react-native-navigation/blob/v2/lib/src/Navigation.ts#L122)
|
134
|
115
|
|
135
|
116
|
Pop the component's stack to root.
|
136
|
117
|
|
137
|
|
-#### Arguments
|
138
|
|
-- componentId (`string`)
|
|
118
|
+---
|
139
|
119
|
|
140
|
|
-#### Returns
|
141
|
|
-- (`Promise<any>`)
|
|
120
|
+## setStackRoot
|
142
|
121
|
|
143
|
|
-### `setStackRoot(componentId: string, layout: any): Promise<any>`
|
|
122
|
+`setStackRoot(componentId: string, layout: any): Promise<any>`
|
144
|
123
|
|
145
|
|
-[source](/lib/src//Navigation.ts#129)
|
|
124
|
+[source](https://github.com/wix/react-native-navigation/blob/v2/lib/src/Navigation.ts#L129)
|
146
|
125
|
|
147
|
126
|
Sets new root component to stack.
|
148
|
127
|
|
149
|
|
-#### Arguments
|
150
|
|
-- componentId (`string`)
|
151
|
|
-- layout (`any`)
|
|
128
|
+---
|
152
|
129
|
|
153
|
|
-#### Returns
|
154
|
|
-- (`Promise<any>`)
|
|
130
|
+## showOverlay
|
155
|
131
|
|
156
|
|
-### `showOverlay(layout: any): Promise<any>`
|
|
132
|
+`showOverlay(layout: any): Promise<any>`
|
157
|
133
|
|
158
|
|
-[source](/lib/src//Navigation.ts#136)
|
|
134
|
+[source](https://github.com/wix/react-native-navigation/blob/v2/lib/src/Navigation.ts#L136)
|
159
|
135
|
|
160
|
136
|
Show overlay on top of the entire app
|
161
|
137
|
|
162
|
|
-#### Arguments
|
163
|
|
-- layout (`any`)
|
|
138
|
+---
|
164
|
139
|
|
165
|
|
-#### Returns
|
166
|
|
-- (`Promise<any>`)
|
|
140
|
+## dismissOverlay
|
167
|
141
|
|
168
|
|
-### `dismissOverlay(componentId: string): Promise<any>`
|
|
142
|
+`dismissOverlay(componentId: string): Promise<any>`
|
169
|
143
|
|
170
|
|
-[source](/lib/src//Navigation.ts#143)
|
|
144
|
+[source](https://github.com/wix/react-native-navigation/blob/v2/lib/src/Navigation.ts#L143)
|
171
|
145
|
|
172
|
146
|
dismiss overlay by componentId
|
173
|
147
|
|
174
|
|
-#### Arguments
|
175
|
|
-- componentId (`string`)
|
|
148
|
+---
|
176
|
149
|
|
177
|
|
-#### Returns
|
178
|
|
-- (`Promise<any>`)
|
|
150
|
+## events
|
179
|
151
|
|
180
|
|
-### `events(): EventsRegistry`
|
|
152
|
+`events(): EventsRegistry`
|
181
|
153
|
|
182
|
|
-[source](/lib/src//Navigation.ts#150)
|
|
154
|
+[source](https://github.com/wix/react-native-navigation/blob/v2/lib/src/Navigation.ts#L150)
|
183
|
155
|
|
184
|
156
|
Obtain the events registry instance
|
185
|
157
|
|
186
|
|
-#### Returns
|
187
|
|
-- (`EventsRegistry`)
|
|
158
|
+---
|
|
159
|
+
|
188
|
160
|
|