expo-router: 'intents' and pathPrefix issues.

Please provide the following:

  1. SDK Version: 49
  2. Platforms(Android/iOS/web/all): all

Hello :wave:

I have setup an intent filter with a pathPrefix='/share'.
A typical deep link may look like this ‘https://my.website.com/share/post/345’.
Unfortunately expo-router is messing up any intents that arrive when my app opens as it tries to open the path /share/post/345 instead of /post/345!

I cannot for the life of me workout how to stop this from happening or redirect to a correct location.

If I try to use expo-linking to listen for an intent and redirect in the root _layout.tsx file i just get this error: ERROR Error: Attempted to navigate before mounting the Root Layout component. Ensure the Root Layout component is rendering a Slot, or other navigator on the first render.

If I use expo-linking after RootLayout component has rendered it’s too late as expo-router has already routed to the [...missing].tsx page :melting_face:

I want to be able to either amend the intent or change the path before expo-router uses it.

Can anyone help?

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