Skip to content

Commit 79c8b21

Browse files
committed
Update linking docs
1 parent 842a2fa commit 79c8b21

File tree

7 files changed

+292
-215
lines changed

7 files changed

+292
-215
lines changed

blog/2020-05-16-web-support.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ Example:
3838
const linking = {
3939
prefixes: ['https://mychat.com', 'mychat://'],
4040
config: {
41-
Home: '',
42-
Profile: ':id/profile',
43-
Settings: ':id/blog',
41+
screens: {
42+
Home: '',
43+
Profile: ':id/profile',
44+
Settings: ':id/blog',
45+
}
4446
},
4547
};
4648

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"@docusaurus/core": "2.0.0-alpha.43",
1515
"@docusaurus/plugin-google-analytics": "^2.0.0-alpha.37",
1616
"@docusaurus/preset-classic": "2.0.0-alpha.43",
17-
"@react-navigation/core": "^5.10.0",
17+
"@react-navigation/core": "^5.11.0",
1818
"classnames": "^2.2.6",
1919
"escape-html": "^1.0.3",
2020
"mkdirp": "^1.0.3",

src/components/LinkingTester.js

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,23 @@ export default function LinkingTester() {
1616

1717
const [rawConfig, setRawConfig] = React.useState(
1818
`{
19-
Home: {
20-
initialRouteName: 'Feed',
21-
screens: {
22-
Profile: {
23-
path: 'user/:id',
24-
parse: {
25-
id: id => id.replace(/^@/, ''),
26-
},
27-
screens: {
28-
Settings: 'edit',
19+
screens: {
20+
Home: {
21+
initialRouteName: 'Feed',
22+
screens: {
23+
Profile: {
24+
path: 'user/:id',
25+
parse: {
26+
id: id => id.replace(/^@/, ''),
27+
},
28+
screens: {
29+
Settings: 'edit',
30+
},
2931
},
3032
},
3133
},
32-
},
33-
NoMatch: '*',
34+
NoMatch: '*',
35+
}
3436
}`
3537
);
3638

@@ -114,7 +116,7 @@ export default function LinkingTester() {
114116
</Highlight>
115117
) : state ? (
116118
<RouteMap routes={state.routes} />
117-
) : null}
119+
) : <p style={styles.error}>Failed to parse the path. Make sure that the path matches the patterns specified in the config.</p>}
118120
</div>
119121
</>
120122
);
@@ -169,4 +171,8 @@ const styles = {
169171
MozAppearance: 'none',
170172
WebkitAppearance: 'none',
171173
},
174+
error: {
175+
margin: 24,
176+
color: '#A12027'
177+
}
172178
};

0 commit comments

Comments
 (0)