forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
515 lines (505 loc) · 75.7 KB
/
index.html
File metadata and controls
515 lines (505 loc) · 75.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>Navigator · React Native</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta name="description" content="`Navigator` handles the transition between different scenes in your app. It is implemented in JavaScript and is available on both Android and iOS. If you are targeting iOS only, you may also want to consider using `NavigatorIOS` as it leverages native UIKit navigation."/><meta name="docsearch:version" content="0.39"/><meta name="docsearch:language" content="en"/><meta property="og:title" content="Navigator · React Native"/><meta property="og:type" content="website"/><meta property="og:url" content="https://reactnative.dev/"/><meta property="og:description" content="`Navigator` handles the transition between different scenes in your app. It is implemented in JavaScript and is available on both Android and iOS. If you are targeting iOS only, you may also want to consider using `NavigatorIOS` as it leverages native UIKit navigation."/><meta property="og:image" content="https://reactnative.dev/img/logo-og.png"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://reactnative.dev/img/logo-og.png"/><link rel="shortcut icon" href="/img/favicon.ico"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/solarized-dark.min.css"/><link rel="alternate" type="application/atom+xml" href="https://reactnative.dev/blog/atom.xml" title="React Native Blog ATOM Feed"/><link rel="alternate" type="application/rss+xml" href="https://reactnative.dev/blog/feed.xml" title="React Native Blog RSS Feed"/><script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-41298772-2', 'auto');
ga('send', 'pageview');
</script><script type="text/javascript" src="https://cdn.jsdelivr.net/npm/focus-visible@5.0.2/dist/focus-visible.min.js"></script><script type="text/javascript" src="https://snack.expo.io/embed.js"></script><script type="text/javascript" src="https://platform.twitter.com/widgets.js"></script><script type="text/javascript" src="https://buttons.github.io/buttons.js"></script><script type="text/javascript" src="/js/codeblocks.js"></script><script type="text/javascript" src="/js/tabs.js"></script><script type="text/javascript" src="/js/docs-rating.js"></script><script type="text/javascript" src="/js/announcement.js"></script><script src="https://unpkg.com/vanilla-back-to-top@7.1.14/dist/vanilla-back-to-top.min.js"></script><script>
document.addEventListener('DOMContentLoaded', function() {
addBackToTop(
{"zIndex":100}
)
});
</script><script src="/js/scrollSpy.js"></script><link rel="stylesheet" href="/css/prism.css"/><link rel="stylesheet" href="/css/main.css"/><script src="/js/codetabs.js"></script></head><body class="sideNavVisible separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/"><img class="logo" src="/img/header_logo.svg" alt="React Native"/><h2 class="headerTitleWithLogo">React Native</h2></a><a href="/versions"><h3>0.39</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/0.39/getting-started" target="_self">Docs</a></li><li class="siteNavGroupActive"><a href="/docs/0.39/components-and-apis" target="_self">Components</a></li><li class=""><a href="/docs/0.39/accessibilityinfo" target="_self">API</a></li><li class=""><a href="/help" target="_self">Community</a></li><li class=""><a href="/blog/" target="_self">Blog</a></li><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li><li class=""><a href="https://github.com/facebook/react-native" target="_self">GitHub</a></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><div class="hamburger-menu"><div class="line1"></div><div class="line2"></div><div class="line3"></div></div></div><h2><i>›</i><span>Components</span></h2><div class="tocToggler" id="tocToggler"><i class="icon-toc"></i></div></div><div class="navGroups"><div class="navGroup"><h3 class="navGroupCategoryTitle collapsible">The Basics<span class="arrow"><svg width="24" height="24" viewBox="0 0 24 24"><path fill="#565656" d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg></span></h3><ul class="hide"><li class="navListItem"><a class="navItem" href="/docs/0.39/getting-started">Getting Started</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/tutorial">Learn the Basics</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/props">Props</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/state">State</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/style">Style</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/height-and-width">Height and Width</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/flexbox">Layout with Flexbox</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/handling-text-input">Handling Text Input</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/handling-touches">Handling Touches</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/using-a-scrollview">Using a ScrollView</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/using-a-listview">Using List Views</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/network">Networking</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/more-resources">More Resources</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle collapsible">Guides<span class="arrow"><svg width="24" height="24" viewBox="0 0 24 24"><path fill="#565656" d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg></span></h3><ul class="hide"><li class="navListItem"><a class="navItem" href="/docs/0.39/components-and-apis">Components and APIs</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/platform-specific-code">Platform Specific Code</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/navigation">Navigating Between Screens</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/images">Images</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/animations">Animations</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/accessibility">Accessibility</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/improvingux">Improving User Experience</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/timers">Timers</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/debugging">Debugging</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/performance">Performance</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/gesture-responder-system">Gesture Responder System</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/javascript-environment">JavaScript Environment</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/direct-manipulation">Direct Manipulation</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/colors">Color Reference</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/integration-with-existing-apps">Integration with Existing Apps</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/running-on-device">Running On Device</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/upgrading">Upgrading to new React Native versions</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/troubleshooting">Troubleshooting</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/native-modules-setup">Native Modules Setup</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle collapsible">Guides (iOS)<span class="arrow"><svg width="24" height="24" viewBox="0 0 24 24"><path fill="#565656" d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg></span></h3><ul class="hide"><li class="navListItem"><a class="navItem" href="/docs/0.39/native-modules-ios">Native Modules</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/native-components-ios">Native UI Components</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/linking-libraries-ios">Linking Libraries</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/running-on-simulator-ios">Running On Simulator</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/communication-ios">Communication between native and React Native</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/building-for-tv">Building For TV Devices</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/app-extensions">App Extensions</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle collapsible">Guides (Android)<span class="arrow"><svg width="24" height="24" viewBox="0 0 24 24"><path fill="#565656" d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg></span></h3><ul class="hide"><li class="navListItem"><a class="navItem" href="/docs/0.39/native-modules-android">Native Modules</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/native-components-android">Native UI Components</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/headless-js-android">Headless JS</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/signed-apk-android">Publishing to Google Play Store</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/removing-default-permissions">Removing Default Permissions</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle collapsible">Components<span class="arrow"><svg width="24" height="24" viewBox="0 0 24 24"><path fill="#565656" d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg></span></h3><ul class="hide"><li class="navListItem"><a class="navItem" href="/docs/0.39/activityindicator">ActivityIndicator</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/button">Button</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/datepickerios">DatePickerIOS</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/drawerlayoutandroid">DrawerLayoutAndroid</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/image">Image</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/keyboardavoidingview">KeyboardAvoidingView</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/modal">Modal</a></li><li class="navListItem navListItemActive"><a class="navItem" href="/docs/0.39/navigator">Navigator</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/navigatorios">NavigatorIOS</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/picker">Picker</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/pickerios">PickerIOS</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/progressbarandroid">ProgressBarAndroid</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/progressviewios">ProgressViewIOS</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/refreshcontrol">RefreshControl</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/scrollview">ScrollView</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/segmentedcontrolios">SegmentedControlIOS</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/slider">Slider</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/snapshotviewios">SnapshotViewIOS</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/statusbar">StatusBar</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/switch">Switch</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/tabbarios">TabBarIOS</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/tabbarios-item">TabBarIOS.Item</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/text">Text</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/textinput">TextInput</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/toolbarandroid">ToolbarAndroid</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/touchablehighlight">TouchableHighlight</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/touchablenativefeedback">TouchableNativeFeedback</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/touchableopacity">TouchableOpacity</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/touchablewithoutfeedback">TouchableWithoutFeedback</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/viewpagerandroid">ViewPagerAndroid</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/webview">WebView</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle collapsible">APIs<span class="arrow"><svg width="24" height="24" viewBox="0 0 24 24"><path fill="#565656" d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg></span></h3><ul class="hide"><li class="navListItem"><a class="navItem" href="/docs/0.39/actionsheetios">ActionSheetIOS</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/alert">Alert</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/alertios">AlertIOS</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/animated">Animated</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/appregistry">AppRegistry</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/appstate">AppState</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/asyncstorage">AsyncStorage</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/cameraroll">CameraRoll</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/clipboard">Clipboard</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/datepickerandroid">DatePickerAndroid</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/dimensions">Dimensions</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/easing">Easing</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/geolocation">Geolocation</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/imageeditor">ImageEditor</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/imagepickerios">ImagePickerIOS</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/imagestore">ImageStore</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/image-style-props">Image Style Props</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/interactionmanager">InteractionManager</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/keyboard">Keyboard</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/layout-props">Layout Props</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/layoutanimation">LayoutAnimation</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/linking">Linking</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/netinfo">NetInfo</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/panresponder">PanResponder</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/permissionsandroid">PermissionsAndroid</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/pixelratio">PixelRatio</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/pushnotificationios">PushNotificationIOS</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/settings">Settings</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/shadow-props">Shadow Props</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/share">Share</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/statusbarios">StatusBarIOS</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/stylesheet">StyleSheet</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/systrace">Systrace</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/text-style-props">Text Style Props</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/timepickerandroid">TimePickerAndroid</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/toastandroid">ToastAndroid</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/transforms">Transforms</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/vibration">Vibration</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/vibrationios">VibrationIOS</a></li><li class="navListItem"><a class="navItem" href="/docs/0.39/view-style-props">View Style Props</a></li></ul></div></div></section></div><script>
var coll = document.getElementsByClassName('collapsible');
var checkActiveCategory = true;
for (var i = 0; i < coll.length; i++) {
var links = coll[i].nextElementSibling.getElementsByTagName('*');
if (checkActiveCategory){
for (var j = 0; j < links.length; j++) {
if (links[j].classList.contains('navListItemActive')){
coll[i].nextElementSibling.classList.toggle('hide');
coll[i].childNodes[1].classList.toggle('rotate');
checkActiveCategory = false;
break;
}
}
}
coll[i].addEventListener('click', function() {
var arrow = this.childNodes[1];
arrow.classList.toggle('rotate');
var content = this.nextElementSibling;
content.classList.toggle('hide');
});
}
document.addEventListener('DOMContentLoaded', function() {
createToggler('#navToggler', '#docsNav', 'docsSliderActive');
createToggler('#tocToggler', 'body', 'tocActive');
var headings = document.querySelector('.toc-headings');
headings && headings.addEventListener('click', function(event) {
var el = event.target;
while(el !== headings){
if (el.tagName === 'A') {
document.body.classList.remove('tocActive');
break;
} else{
el = el.parentNode;
}
}
}, false);
function createToggler(togglerSelector, targetSelector, className) {
var toggler = document.querySelector(togglerSelector);
var target = document.querySelector(targetSelector);
if (!toggler) {
return;
}
toggler.onclick = function(event) {
event.preventDefault();
target.classList.toggle(className);
};
}
});
</script></nav></div><div class="container mainContainer docsContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/facebook/react-native-website/blob/master/docs/navigator.md" target="_blank" rel="noreferrer noopener">Edit</a><h1 id="__docusaurus" class="postHeaderTitle">Navigator</h1></header><article><div><span><p><code>Navigator</code> handles the transition between different scenes in your app. It is implemented in JavaScript and is available on both Android and iOS. If you are targeting iOS only, you may also want to consider using <code>NavigatorIOS</code> as it leverages native UIKit navigation.</p>
<p>To set up the <code>Navigator</code> you provide one or more objects called routes, to identify each scene. You also provide a <code>renderScene</code> function that renders the scene for each route object.</p>
<pre><code class="hljs css language-jsx"><span class="token keyword">import</span> React<span class="token punctuation">,</span> <span class="token punctuation">{</span> Component <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'react'</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token punctuation">{</span>
Text<span class="token punctuation">,</span>
Navigator<span class="token punctuation">,</span>
TouchableHighlight
<span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'react-native'</span><span class="token punctuation">;</span>
<span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token keyword">class</span> <span class="token class-name">NavAllDay</span> <span class="token keyword">extends</span> <span class="token class-name">Component</span> <span class="token punctuation">{</span>
<span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
<span class="token keyword">return</span> <span class="token punctuation">(</span>
<span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Navigator</span></span>
<span class="token attr-name">initialRoute</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token punctuation">{</span> title<span class="token punctuation">:</span> <span class="token string">'Awesome Scene'</span><span class="token punctuation">,</span> index<span class="token punctuation">:</span> <span class="token number">0</span> <span class="token punctuation">}</span><span class="token punctuation">}</span></span>
<span class="token attr-name">renderScene</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token punctuation">(</span><span class="token parameter">route<span class="token punctuation">,</span> navigator</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">(</span>
<span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Text</span></span><span class="token punctuation">></span></span><span class="token plain-text">Hello </span><span class="token punctuation">{</span>route<span class="token punctuation">.</span>title<span class="token punctuation">}</span><span class="token plain-text">!</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Text</span></span><span class="token punctuation">></span></span>
<span class="token punctuation">)</span><span class="token punctuation">}</span></span>
<span class="token attr-name">style</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token punctuation">{</span> padding<span class="token punctuation">:</span> <span class="token number">100</span> <span class="token punctuation">}</span><span class="token punctuation">}</span></span>
<span class="token punctuation">/></span></span>
<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre>
<p>In the above example, <code>initialRoute</code> is used to specify the first route. It contains a title property that identifies the route. The <code>renderScene</code> prop returns a function that displays text based on the route's title.</p>
<h2><a class="anchor" aria-hidden="true" id="additional-scenes"></a><a href="#additional-scenes" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Additional Scenes</h2>
<p>The first example demonstrated one scene. To set up multiple scenes, you pass the <code>initialRouteStack</code> prop to <code>Navigator</code>:</p>
<pre><code class="hljs css language-jsx"><span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
<span class="token keyword">const</span> routes <span class="token operator">=</span> <span class="token punctuation">[</span>
<span class="token punctuation">{</span>title<span class="token punctuation">:</span> <span class="token string">'First Scene'</span><span class="token punctuation">,</span> index<span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token punctuation">{</span>title<span class="token punctuation">:</span> <span class="token string">'Second Scene'</span><span class="token punctuation">,</span> index<span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token punctuation">]</span><span class="token punctuation">;</span>
<span class="token keyword">return</span> <span class="token punctuation">(</span>
<span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Navigator</span></span>
<span class="token attr-name">initialRoute</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>routes<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">}</span></span>
<span class="token attr-name">initialRouteStack</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>routes<span class="token punctuation">}</span></span>
<span class="token attr-name">renderScene</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token punctuation">(</span><span class="token parameter">route<span class="token punctuation">,</span> navigator</span><span class="token punctuation">)</span> <span class="token operator">=></span>
<span class="token operator"><</span>TouchableHighlight onPress<span class="token operator">=</span><span class="token punctuation">{</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">{</span>
<span class="token keyword">if</span> <span class="token punctuation">(</span>route<span class="token punctuation">.</span>index <span class="token operator">===</span> <span class="token number">0</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
navigator<span class="token punctuation">.</span><span class="token function">push</span><span class="token punctuation">(</span>routes<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span>
navigator<span class="token punctuation">.</span><span class="token function">pop</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token punctuation">}</span><span class="token punctuation">}</span></span><span class="token punctuation">></span></span><span class="token plain-text">
</span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Text</span></span><span class="token punctuation">></span></span><span class="token plain-text">Hello </span><span class="token punctuation">{</span>route<span class="token punctuation">.</span>title<span class="token punctuation">}</span><span class="token plain-text">!</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Text</span></span><span class="token punctuation">></span></span><span class="token plain-text">
</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">TouchableHighlight</span></span><span class="token punctuation">></span></span><span class="token plain-text">
}
style=</span><span class="token punctuation">{</span><span class="token punctuation">{</span>padding<span class="token punctuation">:</span> <span class="token number">100</span><span class="token punctuation">}</span><span class="token punctuation">}</span><span class="token plain-text">
/>
);
}
</span></code></pre>
<p>In the above example, a routes variable is defined with two route objects representing two scenes. Each route has an index property that is used to manage the scene being rendered. The <code>renderScene</code> method is changed to either <code>push</code> or <code>pop</code> the navigator depending on the current route's index. Finally, the <code>Text</code> component in the scene is now wrapped in a <code>TouchableHighlight</code> component to help trigger the navigator transitions.</p>
<h2><a class="anchor" aria-hidden="true" id="navigation-bar"></a><a href="#navigation-bar" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Navigation Bar</h2>
<p>You can optionally pass in your own navigation bar by returning a <code>Navigator.NavigationBar</code> component to the <code>navigationBar</code> prop in <code>Navigator</code>. You can configure the navigation bar properties, through the <code>routeMapper</code> prop. There you set up the left, right, and title properties of the navigation bar:</p>
<pre><code class="hljs"><Navigator
renderScene={(route, navigator) =>
<span class="hljs-comment">// ...</span>
}
navigationBar={
<Navigator.NavigationBar
routeMapper={{
<span class="hljs-attr">LeftButton</span>: <span class="hljs-function">(<span class="hljs-params">route, navigator, index, navState</span>) =></span>
{ <span class="hljs-keyword">return</span> (<span class="xml"><span class="hljs-tag"><<span class="hljs-name">Text</span>></span>Cancel<span class="hljs-tag"></<span class="hljs-name">Text</span>></span></span>); },
<span class="hljs-attr">RightButton</span>: <span class="hljs-function">(<span class="hljs-params">route, navigator, index, navState</span>) =></span>
{ <span class="hljs-keyword">return</span> (<span class="xml"><span class="hljs-tag"><<span class="hljs-name">Text</span>></span>Done<span class="hljs-tag"></<span class="hljs-name">Text</span>></span></span>); },
<span class="hljs-attr">Title</span>: <span class="hljs-function">(<span class="hljs-params">route, navigator, index, navState</span>) =></span>
{ <span class="hljs-keyword">return</span> (<span class="xml"><span class="hljs-tag"><<span class="hljs-name">Text</span>></span>Awesome Nav Bar<span class="hljs-tag"></<span class="hljs-name">Text</span>></span></span>); },
}}
style={{<span class="hljs-attr">backgroundColor</span>: <span class="hljs-string">'gray'</span>}}
/>
}
/>
</code></pre>
<p>When configuring the left, right, and title items for the navigation bar, you have access to info such as the current route object and navigation state. This allows you to customize the title for each scene as well as the buttons. For example, you can choose to hide the left button for one of the scenes.</p>
<p>Typically you want buttons to represent the left and right buttons. Building on the previous example, you can set this up as follows:</p>
<pre><code class="hljs">LeftButton: <span class="hljs-function">(<span class="hljs-params">route, navigator, index, navState</span>) =></span>
{
<span class="hljs-keyword">if</span> (route.index === <span class="hljs-number">0</span>) {
<span class="hljs-keyword">return</span> <span class="hljs-literal">null</span>;
} <span class="hljs-keyword">else</span> {
<span class="hljs-keyword">return</span> (
<span class="xml"><span class="hljs-tag"><<span class="hljs-name">TouchableHighlight</span> <span class="hljs-attr">onPress</span>=<span class="hljs-string">{()</span> =></span> navigator.pop()}>
<span class="hljs-tag"><<span class="hljs-name">Text</span>></span>Back<span class="hljs-tag"></<span class="hljs-name">Text</span>></span>
<span class="hljs-tag"></<span class="hljs-name">TouchableHighlight</span>></span></span>
);
}
},
</code></pre>
<p>This sets up a left navigator bar button that's visible on scenes after the the first one. When the button is tapped the navigator is popped.</p>
<p>Another type of navigation bar, with breadcrumbs, is provided by <code>Navigator.BreadcrumbNavigationBar</code>. You can also provide your own navigation bar by passing it through the <code>navigationBar</code> prop.</p>
<h2><a class="anchor" aria-hidden="true" id="scene-transitions"></a><a href="#scene-transitions" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Scene Transitions</h2>
<p>To change the animation or gesture properties of the scene, provide a <code>configureScene</code> prop to get the config object for a given route:</p>
<pre><code class="hljs"><Navigator
renderScene={<span class="hljs-function">(<span class="hljs-params">route, navigator</span>) =></span>
<span class="hljs-comment">// ...</span>
}
configureScene={<span class="hljs-function">(<span class="hljs-params">route, routeStack</span>) =></span>
Navigator.SceneConfigs.FloatFromBottom}
/>
</code></pre>
<p>In the above example, the newly pushed scene will float up from the bottom. See <code>Navigator.SceneConfigs</code> for default animations and more info on available <a href="navigator.md#configurescene">scene config options</a>.</p>
<h3><a class="anchor" aria-hidden="true" id="props"></a><a href="#props" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Props</h3>
<ul>
<li><a href="navigator.md#configurescene"><code>configureScene</code></a></li>
<li><a href="navigator.md#initialroute"><code>initialRoute</code></a></li>
<li><a href="navigator.md#initialroutestack"><code>initialRouteStack</code></a></li>
<li><a href="navigator.md#navigationbar"><code>navigationBar</code></a></li>
<li><a href="navigator.md#navigator"><code>navigator</code></a></li>
<li><a href="navigator.md#ondidfocus"><code>onDidFocus</code></a></li>
<li><a href="navigator.md#onwillfocus"><code>onWillFocus</code></a></li>
<li><a href="navigator.md#renderscene"><code>renderScene</code></a></li>
<li><a href="navigator.md#scenestyle"><code>sceneStyle</code></a></li>
</ul>
<h3><a class="anchor" aria-hidden="true" id="methods"></a><a href="#methods" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Methods</h3>
<ul>
<li><a href="navigator.md#immediatelyresetroutestack"><code>immediatelyResetRouteStack</code></a></li>
<li><a href="navigator.md#jumpto"><code>jumpTo</code></a></li>
<li><a href="navigator.md#jumpforward"><code>jumpForward</code></a></li>
<li><a href="navigator.md#jumpback"><code>jumpBack</code></a></li>
<li><a href="navigator.md#push"><code>push</code></a></li>
<li><a href="navigator.md#popn"><code>popN</code></a></li>
<li><a href="navigator.md#pop"><code>pop</code></a></li>
<li><a href="navigator.md#replaceatindex"><code>replaceAtIndex</code></a></li>
<li><a href="navigator.md#replace"><code>replace</code></a></li>
<li><a href="navigator.md#replaceprevious"><code>replacePrevious</code></a></li>
<li><a href="navigator.md#poptotop"><code>popToTop</code></a></li>
<li><a href="navigator.md#poptoroute"><code>popToRoute</code></a></li>
<li><a href="navigator.md#replacepreviousandpop"><code>replacePreviousAndPop</code></a></li>
<li><a href="navigator.md#resetto"><code>resetTo</code></a></li>
<li><a href="navigator.md#getcurrentroutes"><code>getCurrentRoutes</code></a></li>
</ul>
<hr>
<h1><a class="anchor" aria-hidden="true" id="reference"></a><a href="#reference" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Reference</h1>
<h2><a class="anchor" aria-hidden="true" id="props-1"></a><a href="#props-1" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Props</h2>
<h3><a class="anchor" aria-hidden="true" id="configurescene"></a><a href="#configurescene" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>configureScene</code></h3>
<p>Optional function where you can configure scene animations and gestures. Will be invoked with <code>route</code> and <code>routeStack</code> parameters, where route corresponds to the current scene being rendered by the <code>Navigator</code> and <code>routeStack</code> is the set of currently mounted routes that the navigator could transition to.</p>
<p>The function should return a scene configuration object.</p>
<pre><code class="hljs css language-jsx"><span class="token punctuation">(</span><span class="token parameter">route<span class="token punctuation">,</span> routeStack</span><span class="token punctuation">)</span> <span class="token operator">=></span> Navigator<span class="token punctuation">.</span>SceneConfigs<span class="token punctuation">.</span>FloatFromRight<span class="token punctuation">;</span>
</code></pre>
<p>Available scene configuration options are:</p>
<ul>
<li>Navigator.SceneConfigs.PushFromRight (default)</li>
<li>Navigator.SceneConfigs.FloatFromRight</li>
<li>Navigator.SceneConfigs.FloatFromLeft</li>
<li>Navigator.SceneConfigs.FloatFromBottom</li>
<li>Navigator.SceneConfigs.FloatFromBottomAndroid</li>
<li>Navigator.SceneConfigs.FadeAndroid</li>
<li>Navigator.SceneConfigs.SwipeFromLeft</li>
<li>Navigator.SceneConfigs.HorizontalSwipeJump</li>
<li>Navigator.SceneConfigs.HorizontalSwipeJumpFromRight</li>
<li>Navigator.SceneConfigs.HorizontalSwipeJumpFromLeft</li>
<li>Navigator.SceneConfigs.VerticalUpSwipeJump</li>
<li>Navigator.SceneConfigs.VerticalDownSwipeJump</li>
</ul>
<table>
<thead>
<tr><th>Type</th><th>Required</th></tr>
</thead>
<tbody>
<tr><td>function</td><td>No</td></tr>
</tbody>
</table>
<hr>
<h3><a class="anchor" aria-hidden="true" id="initialroute"></a><a href="#initialroute" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>initialRoute</code></h3>
<p>The initial route for navigation. A route is an object that the navigator will use to identify each scene it renders.</p>
<p>If both <code>initialRoute</code> and <code>initialRouteStack</code> props are passed to <code>Navigator</code>, then <code>initialRoute</code> must be in a route in <code>initialRouteStack</code>. If <code>initialRouteStack</code> is passed as a prop but <code>initialRoute</code> is not, then <code>initialRoute</code> will default internally to the last item in <code>initialRouteStack</code>.</p>
<table>
<thead>
<tr><th>Type</th><th>Required</th></tr>
</thead>
<tbody>
<tr><td>object</td><td>No</td></tr>
</tbody>
</table>
<hr>
<h3><a class="anchor" aria-hidden="true" id="initialroutestack"></a><a href="#initialroutestack" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>initialRouteStack</code></h3>
<p>Pass this in to provide a set of routes to initially mount. This prop is required if <code>initialRoute</code> is not provided to the navigator. If this prop is not passed in, it will default internally to an array containing only <code>initialRoute</code>.</p>
<table>
<thead>
<tr><th>Type</th><th>Required</th></tr>
</thead>
<tbody>
<tr><td>[object]</td><td>No</td></tr>
</tbody>
</table>
<hr>
<h3><a class="anchor" aria-hidden="true" id="navigationbar"></a><a href="#navigationbar" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>navigationBar</code></h3>
<p>Use this to provide an optional component representing a navigation bar that is persisted across scene transitions. This component will receive two props: navigator and navState representing the navigator component and its state. The component is re-rendered when the route changes.</p>
<table>
<thead>
<tr><th>Type</th><th>Required</th></tr>
</thead>
<tbody>
<tr><td>node</td><td>No</td></tr>
</tbody>
</table>
<hr>
<h3><a class="anchor" aria-hidden="true" id="navigator"></a><a href="#navigator" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>navigator</code></h3>
<p>Optionally pass in the navigator object from a parent Navigator.</p>
<table>
<thead>
<tr><th>Type</th><th>Required</th></tr>
</thead>
<tbody>
<tr><td>object</td><td>No</td></tr>
</tbody>
</table>
<hr>
<h3><a class="anchor" aria-hidden="true" id="ondidfocus"></a><a href="#ondidfocus" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>onDidFocus</code></h3>
<p>Will be called with the new route of each scene after the transition is complete or after the initial mounting.</p>
<table>
<thead>
<tr><th>Type</th><th>Required</th></tr>
</thead>
<tbody>
<tr><td>function</td><td>No</td></tr>
</tbody>
</table>
<hr>
<h3><a class="anchor" aria-hidden="true" id="onwillfocus"></a><a href="#onwillfocus" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>onWillFocus</code></h3>
<p>Pass in a function to get notified with the target route when the navigator component is mounted and before each navigator transition.</p>
<table>
<thead>
<tr><th>Type</th><th>Required</th></tr>
</thead>
<tbody>
<tr><td>function</td><td>No</td></tr>
</tbody>
</table>
<hr>
<h3><a class="anchor" aria-hidden="true" id="renderscene"></a><a href="#renderscene" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>renderScene</code></h3>
<p>Required function which renders the scene for a given route. Will be invoked with the route and the navigator object.</p>
<pre><code class="hljs css language-jsx"><span class="token punctuation">(</span><span class="token parameter">route<span class="token punctuation">,</span> navigator</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">(</span>
<span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">MySceneComponent</span></span> <span class="token attr-name">title</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>route<span class="token punctuation">.</span>title<span class="token punctuation">}</span></span> <span class="token attr-name">navigator</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>navigator<span class="token punctuation">}</span></span> <span class="token punctuation">/></span></span>
<span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
<table>
<thead>
<tr><th>Type</th><th>Required</th></tr>
</thead>
<tbody>
<tr><td>function</td><td>Yes</td></tr>
</tbody>
</table>
<hr>
<h3><a class="anchor" aria-hidden="true" id="scenestyle"></a><a href="#scenestyle" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>sceneStyle</code></h3>
<p>Styles to apply to the container of each scene.</p>
<table>
<thead>
<tr><th>Type</th><th>Required</th></tr>
</thead>
<tbody>
<tr><td><a href="/docs/0.39/style">style</a></td><td>No</td></tr>
</tbody>
</table>
<h2><a class="anchor" aria-hidden="true" id="methods-1"></a><a href="#methods-1" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Methods</h2>
<hr>
<h3><a class="anchor" aria-hidden="true" id="immediatelyresetroutestack"></a><a href="#immediatelyresetroutestack" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>immediatelyResetRouteStack()</code></h3>
<pre><code class="hljs css language-jsx"><span class="token function">immediatelyResetRouteStack</span><span class="token punctuation">(</span><span class="token punctuation">(</span>nextRouteStack<span class="token punctuation">:</span> RouteStack<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
<p>Reset every scene with an array of routes. All existing route stacks are destroyed and potentially recreated. There is no accompanying animation and this method immediately replaces and re-renders the navigation bar and the stack items.</p>
<p><strong>Parameters:</strong></p>
<table>
<thead>
<tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
</thead>
<tbody>
<tr><td>nextRouteStack</td><td>RouteStack</td><td>Yes</td><td>Next route stack to reinitialize.</td></tr>
</tbody>
</table>
<hr>
<h3><a class="anchor" aria-hidden="true" id="jumpto"></a><a href="#jumpto" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>jumpTo()</code></h3>
<pre><code class="hljs css language-jsx"><span class="token function">jumpTo</span><span class="token punctuation">(</span><span class="token punctuation">(</span>route<span class="token punctuation">:</span> object<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
<p>Transition to an existing scene without unmounting.</p>
<p>The specified route must be in the currently mounted set of routes defined in <code>routeStack</code>.</p>
<p><strong>Parameters:</strong></p>
<table>
<thead>
<tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
</thead>
<tbody>
<tr><td>route</td><td>object</td><td>Yes No</td><td>Route to transition to.</td></tr>
</tbody>
</table>
<hr>
<h3><a class="anchor" aria-hidden="true" id="jumpforward"></a><a href="#jumpforward" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>jumpForward()</code></h3>
<pre><code class="hljs css language-jsx"><span class="token function">jumpForward</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
<p>Jump forward to the next scene in the route stack.</p>
<hr>
<h3><a class="anchor" aria-hidden="true" id="jumpback"></a><a href="#jumpback" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>jumpBack()</code></h3>
<pre><code class="hljs css language-jsx"><span class="token function">jumpBack</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
<p>Jump backward without unmounting the current scene.</p>
<hr>
<h3><a class="anchor" aria-hidden="true" id="push"></a><a href="#push" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>push()</code></h3>
<pre><code class="hljs css language-jsx"><span class="token function">push</span><span class="token punctuation">(</span><span class="token punctuation">(</span>route<span class="token punctuation">:</span> object<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
<p>Navigate forward to a new scene, squashing any scenes that you could jump forward to.</p>
<p><strong>Parameters:</strong></p>
<table>
<thead>
<tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
</thead>
<tbody>
<tr><td>route</td><td>object</td><td>Yes No</td><td>Route to push into the navigator stack.</td></tr>
</tbody>
</table>
<hr>
<h3><a class="anchor" aria-hidden="true" id="popn"></a><a href="#popn" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>popN()</code></h3>
<pre><code class="hljs css language-jsx"><span class="token function">popN</span><span class="token punctuation">(</span><span class="token punctuation">(</span>n<span class="token punctuation">:</span> number<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
<p>Go back N scenes at once. When N=1, behavior matches <code>pop()</code>. When N is invalid (negative or bigger than current routes count), do nothing.</p>
<p><strong>Parameters:</strong></p>
<table>
<thead>
<tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
</thead>
<tbody>
<tr><td>n</td><td>number</td><td>Yes</td><td>The number of scenes to pop. Should be an integer.</td></tr>
</tbody>
</table>
<hr>
<h3><a class="anchor" aria-hidden="true" id="pop"></a><a href="#pop" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>pop()</code></h3>
<pre><code class="hljs css language-jsx"><span class="token function">pop</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
<p>Transition back and unmount the current scene.</p>
<hr>
<h3><a class="anchor" aria-hidden="true" id="replaceatindex"></a><a href="#replaceatindex" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>replaceAtIndex()</code></h3>
<pre><code class="hljs css language-jsx"><span class="token function">replaceAtIndex</span><span class="token punctuation">(</span><span class="token punctuation">(</span>route<span class="token punctuation">:</span> object<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token punctuation">(</span>index<span class="token punctuation">:</span> number<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token punctuation">(</span>cb<span class="token punctuation">:</span> Function<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
<p>Replace a scene as specified by an index.</p>
<p><strong>Parameters:</strong></p>
<table>
<thead>
<tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
</thead>
<tbody>
<tr><td>route</td><td>object</td><td>Yes</td><td>Route representing the new scene to render.</td></tr>
<tr><td>index</td><td>number</td><td>Yes</td><td>The route in the stack that should be replaced. If negative, it counts from the back of the stack.</td></tr>
<tr><td>cb</td><td>function</td><td>Yes</td><td>Callback function when the scene has been replaced.</td></tr>
</tbody>
</table>
<hr>
<h3><a class="anchor" aria-hidden="true" id="replace"></a><a href="#replace" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>replace()</code></h3>
<pre><code class="hljs css language-jsx"><span class="token function">replace</span><span class="token punctuation">(</span><span class="token punctuation">(</span>route<span class="token punctuation">:</span> object<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
<p>Replace the current scene with a new route.</p>
<p><strong>Parameters:</strong></p>
<table>
<thead>
<tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
</thead>
<tbody>
<tr><td>route</td><td>object</td><td>Yes No</td><td>Route that replaces the current scene.</td></tr>
</tbody>
</table>
<hr>
<h3><a class="anchor" aria-hidden="true" id="replaceprevious"></a><a href="#replaceprevious" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>replacePrevious()</code></h3>
<pre><code class="hljs css language-jsx"><span class="token function">replacePrevious</span><span class="token punctuation">(</span><span class="token punctuation">(</span>route<span class="token punctuation">:</span> object<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
<p>Replace the previous scene.</p>
<p><strong>Parameters:</strong></p>
<table>
<thead>
<tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
</thead>
<tbody>
<tr><td>route</td><td>object</td><td>Yes</td><td>Route that replaces the previous scene.</td></tr>
</tbody>
</table>
<hr>
<h3><a class="anchor" aria-hidden="true" id="poptotop"></a><a href="#poptotop" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>popToTop()</code></h3>
<pre><code class="hljs css language-jsx"><span class="token function">popToTop</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
<p>Get the first scene in the stack, unmounting every other scene.</p>
<hr>
<h3><a class="anchor" aria-hidden="true" id="poptoroute"></a><a href="#poptoroute" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>popToRoute()</code></h3>
<pre><code class="hljs css language-jsx"><span class="token function">popToRoute</span><span class="token punctuation">(</span><span class="token punctuation">(</span>route<span class="token punctuation">:</span> object<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
<p>Get a particular scene, as specified by its route. All scenes after it will be unmounted.</p>
<p><strong>Parameters:</strong></p>
<table>
<thead>
<tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
</thead>
<tbody>
<tr><td>route</td><td>object</td><td>Yes</td><td>Route to pop to.</td></tr>
</tbody>
</table>
<hr>
<h3><a class="anchor" aria-hidden="true" id="replacepreviousandpop"></a><a href="#replacepreviousandpop" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>replacePreviousAndPop()</code></h3>
<pre><code class="hljs css language-jsx"><span class="token function">replacePreviousAndPop</span><span class="token punctuation">(</span><span class="token punctuation">(</span>route<span class="token punctuation">:</span> object<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
<p>Replace the previous scene and get to it.</p>
<p><strong>Parameters:</strong></p>
<table>
<thead>
<tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
</thead>
<tbody>
<tr><td>route</td><td>object</td><td>Yes</td><td>Route that replaces the previous scene.</td></tr>
</tbody>
</table>
<hr>
<h3><a class="anchor" aria-hidden="true" id="resetto"></a><a href="#resetto" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>resetTo()</code></h3>
<pre><code class="hljs css language-jsx"><span class="token function">resetTo</span><span class="token punctuation">(</span><span class="token punctuation">(</span>route<span class="token punctuation">:</span> object<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
<p>Navigate to a new scene and reset route stack.</p>
<p><strong>Parameters:</strong></p>
<table>
<thead>
<tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
</thead>
<tbody>
<tr><td>route</td><td>object</td><td>Yes</td><td>Route to navigate to.</td></tr>
</tbody>
</table>
<hr>
<h3><a class="anchor" aria-hidden="true" id="getcurrentroutes"></a><a href="#getcurrentroutes" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>getCurrentRoutes()</code></h3>
<pre><code class="hljs css language-jsx"><span class="token function">getCurrentRoutes</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
<p>Returns the current list of routes.</p>
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/0.39/modal"><span class="arrow-prev">← </span><span>Modal</span></a><a class="docs-next button" href="/docs/0.39/navigatorios"><span>Next</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#additional-scenes">Additional Scenes</a></li><li><a href="#navigation-bar">Navigation Bar</a></li><li><a href="#scene-transitions">Scene Transitions</a><ul class="toc-headings"><li><a href="#props">Props</a></li><li><a href="#methods">Methods</a></li></ul></li><li><a href="#props-1">Props</a><ul class="toc-headings"><li><a href="#configurescene"><code>configureScene</code></a></li><li><a href="#initialroute"><code>initialRoute</code></a></li><li><a href="#initialroutestack"><code>initialRouteStack</code></a></li><li><a href="#navigationbar"><code>navigationBar</code></a></li><li><a href="#navigator"><code>navigator</code></a></li><li><a href="#ondidfocus"><code>onDidFocus</code></a></li><li><a href="#onwillfocus"><code>onWillFocus</code></a></li><li><a href="#renderscene"><code>renderScene</code></a></li><li><a href="#scenestyle"><code>sceneStyle</code></a></li></ul></li><li><a href="#methods-1">Methods</a><ul class="toc-headings"><li><a href="#immediatelyresetroutestack"><code>immediatelyResetRouteStack()</code></a></li><li><a href="#jumpto"><code>jumpTo()</code></a></li><li><a href="#jumpforward"><code>jumpForward()</code></a></li><li><a href="#jumpback"><code>jumpBack()</code></a></li><li><a href="#push"><code>push()</code></a></li><li><a href="#popn"><code>popN()</code></a></li><li><a href="#pop"><code>pop()</code></a></li><li><a href="#replaceatindex"><code>replaceAtIndex()</code></a></li><li><a href="#replace"><code>replace()</code></a></li><li><a href="#replaceprevious"><code>replacePrevious()</code></a></li><li><a href="#poptotop"><code>popToTop()</code></a></li><li><a href="#poptoroute"><code>popToRoute()</code></a></li><li><a href="#replacepreviousandpop"><code>replacePreviousAndPop()</code></a></li><li><a href="#resetto"><code>resetTo()</code></a></li><li><a href="#getcurrentroutes"><code>getCurrentRoutes()</code></a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><div><h5>Docs</h5><a href="/docs/getting-started">Getting Started</a><a href="/docs/tutorial">Tutorial</a><a href="/docs/components-and-apis">Components and APIs</a><a href="/docs/more-resources">More Resources</a></div><div><h5>Community</h5><a href="/help">The React Native Community</a><a href="/showcase">Who's using React Native?</a><a href="https://stackoverflow.com/questions/tagged/react-native" target="_blank">Ask Questions on Stack Overflow</a><a href="https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md">Contributor Guide</a><a href="https://dev.to/t/reactnative" target="_blank">DEV Community</a></div><div><h5>More Resources</h5><a href="/blog">Blog</a><a href="https://twitter.com/reactnative" target="_blank">Twitter</a><a href="https://github.com/facebook/react-native" target="_blank">GitHub</a><a href="https://reactjs.org" target="_blank">React</a></div></section><a href="https://code.facebook.com/projects/" target="_blank" class="fbOpenSource"><img src="/img/oss_logo.png" alt="Facebook Open Source" width="170" height="45"/></a><section class="copyright">Copyright © 2020 Facebook Inc.</section></footer></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script><script>window.fbAsyncInit = function() {FB.init({appId:'1677033832619985',xfbml:true,version:'v2.7'});};(function(d, s, id){var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) {return;}js = d.createElement(s); js.id = id;js.src = '//connect.facebook.net/en_US/sdk.js';fjs.parentNode.insertBefore(js, fjs);}(document, 'script','facebook-jssdk'));
</script><script>window.twttr=(function(d,s, id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src='https://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js, fjs);t._e = [];t.ready = function(f) {t._e.push(f);};return t;}(document, 'script', 'twitter-wjs'));</script><script>
document.addEventListener('keyup', function(e) {
if (e.target !== document.body) {
return;
}
// keyCode for '/' (slash)
if (e.keyCode === 191) {
const search = document.getElementById('search_input_react');
search && search.focus();
}
});
</script><script>
var search = docsearch({
apiKey: '2c98749b4a1e588efec53b2acec13025',
indexName: 'react-native-versions',
inputSelector: '#search_input_react',
algoliaOptions: {"facetFilters":["tags:0.39"],"hitsPerPage":5}
});
</script></body></html>