Fallback route and onError callback for root navigator
closed
Serhii Palash
I have complex nav reducer with complex logic. It is possible that next nav state redirects on non-existing routeName in some cases.
Can you add api to set "fallback route"? Like on websites there is "fallback on home page".
Error: There is no route defined for key ...
Assume this error has code 404, then
We can write code like this
satya164
closed
Closing since there's no response. And I think we don't need to add features to handle bugs in the app code itself that could be avoided by using a static type system or other approaches like constants.
Qalqi
This is a common need. It should be provided by react navigation.
satya164
> I have complex nav reducer with complex logic. It is possible that next nav state redirects on non-existing routeName in some cases.
That sounds like a bug in your code. Shouldn't you fix it instead?
404/fallback errors on web are for people visiting broken links, which is out of the developer's control, so there's really no better way than a fallback page. But if your own code is doing this, then it should be fixed.