Replies: 1 comment 2 replies
-
I for one would love to have the linking config exposed. I'm currently dealing with handling authentication that uses a hash in the deep link URL, which Expo Router does not handle as a search param and therefore cannot find the screen needed to deal with auth tokens. This was easily achievable via React Navigation which needed a linking prop, where I could customise the config to rewrite the incoming URL to replace the |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
my opinion,
expo/router
killer-feature is provision "free" deep linking. for now linking config forNavigationContainer
generating automatically by getLinkingConfig method. Generates onlypath
andscreens
propsProblem:
no way to set
initialRouteName
to linking config (react-navigation docs). its needed for some cases:initialRouteName
in linking config/profile/orders/3
you needinitialRouteName
on each Navigator levels, or you get wrongback
navigation logicneed to remember,
initialRouteName
in linking config !==initialRouteName
in Navigator props. they have different logic (hi @nandorojo react-navigation #10152)Solutions (as I can see)
expo/router
can and should solve this case automaticallyinitialRouteName
from Navigator and set it to linking options. i tried to do this in Add initialRouteName to linking config #45 pr. the problem is that linking config loads before Navigator rendering. i tried parse component as string, but @EvanBacon right, its stupid. but even if we find a way safety prerender or start app only after loads all screens and generated linking config,initialRouteName
from linking and Navigator still have different logic. i think its bad practice.initialRouteName
based onexpo/router
sorted. sounds like solution and all changes we need at /src/getLinkingConfig.ts:its will solve all problems it this case.
omg, such a simple solution that I don't know why I wrote so much. but in future I think we need tools to merge linking config with custom config.
when i starts wrote this discussion, I thought I'd end with a question: "What do you think about it?". but it seems that the solution came by itself while I was writing 🤷♂️
Beta Was this translation helpful? Give feedback.
All reactions