Skip to content

Commit

Permalink
fix: add error handling for preloading
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardLindhout committed Jul 8, 2023
1 parent 9dbb007 commit d9d5fe9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
10 changes: 1 addition & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -384,15 +384,7 @@ import {
You have to enable url schemes etc in your app and it'll work!
E.g. our example app can open the following urls:
### crumb
### Bottom tabs
navigation://home/post/post-1
## normal stack
If you want to deep link into a bottom tab or other screen you can use the fluent navigation in development mode and it will log the required url to go to the right screen :)
## More
Expand Down
21 changes: 15 additions & 6 deletions src/NavigationProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,17 @@ export default function NavigationProvider<ScreenItems extends BaseScreen[]>({
rootNavigator.navigateLink(uri);
}
} catch (e) {
console.log(`Can't convert deep link to the right stack: ${uri}`, e, {
fallback,
change,
});
console.log(
`[react-native-ridge-navigation] can't convert deep link to the right stack: ${uri}`,
e,
{
fallback,
change,
}
);
if (!fallback && !change) {
console.log(
'there is no app started yet, lets go to the default url}',
console.debug(
'[react-native-ridge-navigation] there is no app started yet, lets go to the default url}',
{ defaultUrl: initialDefaultUrl }
);
// setTimeout(() => {
Expand Down Expand Up @@ -274,6 +278,11 @@ export default function NavigationProvider<ScreenItems extends BaseScreen[]>({
});

const url = fluentNavigator.url;
if (process.env.NODE_ENV === 'development') {
console.log(
`[react-native-ridge-navigation] fluent navigation to ${url}`
);
}
setGoToUrl(url);
},
[navigationRoot, rootNavigator, setGoToUrl]
Expand Down

0 comments on commit d9d5fe9

Please sign in to comment.