You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -499,13 +499,18 @@ For example, if we have `Catalog` screen inside `Home` screen and want it to han
499
499
500
500
```js
501
501
constRootStack=createNativeStackNavigator({
502
-
Home: {
503
-
screens: {
504
-
Catalog: {
505
-
screen: Catalog,
506
-
path:'item/:id',
507
-
parse: {
508
-
id:Number,
502
+
screens: {
503
+
Home: {
504
+
screen: HomeScreen,
505
+
screens: {
506
+
Catalog: {
507
+
screen: Catalog,
508
+
linking: {
509
+
path:'item/:id',
510
+
parse: {
511
+
id:Number,
512
+
},
513
+
},
509
514
},
510
515
},
511
516
},
@@ -543,9 +548,13 @@ The options for parsing can be an object or a string:
543
548
544
549
```js
545
550
constRootStack=createNativeStackNavigator({
546
-
Catalog: {
547
-
screen: Catalog,
548
-
path:'item/:id',
551
+
screens: {
552
+
Catalog: {
553
+
screen: Catalog,
554
+
linking: {
555
+
path:'item/:id',
556
+
},
557
+
},
549
558
},
550
559
});
551
560
```
@@ -570,6 +579,34 @@ The `path` option is a pattern to match against the path. Any segments starting
570
579
571
580
The `initialRouteName` option ensures that the route name passed there will be present in the state for the navigator, e.g. for config:
572
581
582
+
<TabsgroupId="config"queryString="config">
583
+
<TabItemvalue="static"label="Static"default>
584
+
585
+
```js
586
+
constRootStack=createNativeStackNavigator({
587
+
screens: {
588
+
Home: {
589
+
initialRouteName:'Feed',
590
+
screen: HomeScreen,
591
+
linking: {
592
+
screens: {
593
+
Catalog: {
594
+
path:'item/:id',
595
+
parse: {
596
+
id:Number,
597
+
},
598
+
},
599
+
Feed:'feed',
600
+
},
601
+
},
602
+
},
603
+
},
604
+
});
605
+
```
606
+
607
+
</TabItem>
608
+
<TabItemvalue="dynamic"label="Dynamic"default>
609
+
573
610
```js
574
611
{
575
612
screens: {
@@ -589,6 +626,9 @@ The `initialRouteName` option ensures that the route name passed there will be p
589
626
}
590
627
```
591
628
629
+
</TabItem>
630
+
</Tabs>
631
+
592
632
and URL : `/item/42`, the state will look like this:
593
633
594
634
```js
@@ -615,6 +655,34 @@ and URL : `/item/42`, the state will look like this:
615
655
616
656
The `parse` option controls how the params are parsed. Here, you can provide the name of the param to parse as a key, and a function which takes the string value for the param and returns a parsed value:
617
657
658
+
<TabsgroupId="config"queryString="config">
659
+
<TabItemvalue="static"label="Static"default>
660
+
661
+
```js
662
+
constRootStack=createNativeStackNavigator({
663
+
screens: {
664
+
Home: {
665
+
initialRouteName:'Feed',
666
+
screen: HomeScreen,
667
+
linking: {
668
+
screens: {
669
+
Catalog: {
670
+
path:'item/:id',
671
+
parse: {
672
+
id:Number,
673
+
},
674
+
},
675
+
Feed:'feed',
676
+
},
677
+
},
678
+
},
679
+
},
680
+
});
681
+
```
682
+
683
+
</TabItem>
684
+
<TabItemvalue="dynamic"label="Dynamic"default>
685
+
618
686
```js
619
687
{
620
688
screens: {
@@ -628,6 +696,9 @@ The `parse` option controls how the params are parsed. Here, you can provide the
628
696
}
629
697
```
630
698
699
+
</TabItem>
700
+
</Tabs>
701
+
631
702
If no custom function is provided for parsing a param, it'll be parsed as a string.
632
703
633
704
##### `linking.enabled`
@@ -649,10 +720,12 @@ For example, you could do something like following to handle both deep linking a
0 commit comments