Prevent deeplink or router.push before it show the screen

Please provide the following:

  1. SDK Version: 48
  2. Platforms(Android/iOS/web/all): Android / iOS
  3. Add the appropriate “Tag” based on what Expo library you have a question on.

I’m using expo-router and i would like to prevent some route (deeplink or router.push) to be navigated to.

if someone open a deeplink to /welcome but he’s already connected, i’d like to cancel that deeplink instead of navigating to welcome to then have a hook catch that it doesn’t make sense and that redirect to /home

same issues with deeplink directly in the middle of a flow. I get that the idea is that on web you can access any part of the flow with the url but it’s mobile and i don’t care about web so having a bad UX on the native app where you can navigate to a random screen to then be redirect to the beginning of the flow makes no sense and he’s ugly.

it would also let us handle deeplink in notifications that have the same issues. I’d like a direct access to getPathFromState or linking to prevent the navigation before it happens based on app state.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.