Closed crewtaylorfd closed 8 months ago
The asPath will be used on native. Is there a reason to not pass the asPath and have that be what it links to?
The asPath will be used on native. Is there a reason to not pass the asPath and have that be what it links to?
I would like to rewrite the url to hide the query params when on web. That is why I am passing the as
argument here to write the url to just the pathname
.
You could pass asPath on web only
Got it. Wanted to see if there was a way to do it without writing any Platform.OS === 'web'
code.
The as path in my mind is where the native app should go. Because if you want to jump from the website into the app, the browser is going to use what’s in the actual address bar. Hiding params is a rare case on web, typically reserved for modals on top of list pages. And in that case the as path is enough on native
It might be worth asking if hiding the query params is what you actually should be doing here (though I don’t know the use case)
Hiding params can also mess up refreshing, but this shouldn’t matter on native if the as path has the correct params in it too
Is there an existing issue for this?
Do you want this issue prioritized?
Current Behavior
If I do the following
The params are not accessible on native. If I remove the
as
parameter, the second argument torouter.push()
, in this case it is/video/${id}
, the params come back.Expected Behavior
If I pass in an
as
parameter to thepush
function the params should still be accessible on nativeSteps To Reproduce
as
parameter to rewrite the URL.push
functionVersions
Screenshots
No response
Reproduction
No response