You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically if I have a stack navigator inside a drawer navigator, then useLinkProps does not generate correct link for command+click behaviour or for copy link.
I am using react-navigation v6 and expo 49. But in the snack I provided, I am using expo 50 and latest packages. Bundler for web is webpack. But in snack link, it is metro.
I need help with react navigation. It is around how links are generated. I have created a linking config which has a config like
If I am on same browser tab and click on the link that gets generated. I go to correct link which is /item-detail/40?origin=search. However, if I use ⌘+click or right click to open in new tab, the link that I get is /item-detail?itemId=40&origin=search. Notice that itemId is a param now.
How do I make sure that link that is generated is always item-detail/40?
Another thing that I noticed is that if I don't nest Stack Navigator inside Drawer navigator, then I get the correct link no matter if I open in new tab or same tab. But this is not realistic for me because we need that Drawer navigator.
I don't want to create the exact link string myself. I know I can always serialize params for query string myself and give react navigation the exact path. By doing this, I loose strict type checking for params and screen names.
Expected behavior
I should always see generated url as /item-detail/41?origin=search
Hey! This issue is closed and isn't watched by the core team. You are welcome to discuss the issue with others in this thread, but if you think this issue is still valid and needs to be tracked, please open a new issue with a repro.
Current behavior
I am not sure if I am doing something wrong or there is some bug in
useLinkProps
. I posted a stack overflow question as well. Please feel free to close this and answer stack overflow question here React Navigation:useLinkProps
not generating correct link in browser.Basically if I have a stack navigator inside a drawer navigator, then
useLinkProps
does not generate correct link forcommand+click
behaviour or forcopy link
.I am using react-navigation v6 and expo 49. But in the snack I provided, I am using expo 50 and latest packages. Bundler for web is webpack. But in snack link, it is metro.
I need help with react navigation. It is around how links are generated. I have created a linking config which has a config like
I am using
useLinkProps
to generate href links on web. Here is that code snippetIf I am on same browser tab and click on the link that gets generated. I go to correct link which is
/item-detail/40?origin=search
. However, if I use⌘+click
orright click to open in new tab
, the link that I get is/item-detail?itemId=40&origin=search
. Notice thatitemId
is a param now.How do I make sure that link that is generated is always
item-detail/40
?I don't want to create the exact link string myself. I know I can always serialize params for query string myself and give react navigation the exact path. By doing this, I loose strict type checking for params and screen names.
Expected behavior
I should always see generated url as
/item-detail/41?origin=search
Reproduction
https://snack.expo.dev/@khageshfoodapp/hello-react-navigation-|-react-navigation
Platform
Packages
Environment
The text was updated successfully, but these errors were encountered: