-
Notifications
You must be signed in to change notification settings - Fork 28
Hide params from URL #49
Comments
@steventilator A better way to handle this is to have the |
I am also porting my RN project to web and would like to hide the params from the URL. Besides this example, I would like to generally not show the params in the URL. Is there any way to hide them? |
I have same problem with hiding params in URL but I don't send it as params, when component request an API call with some filters, this filter is added to url. How can I prevent it? |
I removed them adding the following custom const linking = {
config: {
screens: {
...
}
},
getPathFromState: (state, options) => {
const cleanState = {
...state,
routes: state.routes.map(route => {
if(!route.params) {
return route
}
const cleanParams = {}
for(const param in route.params) {
const value = route.params[param]
if(typeof value !== "object" && typeof value !== "function") {
cleanParams[param] = value
}
}
return {
...route,
params: cleanParams,
}
}),
}
return getPathFromState(cleanState, options) //imported from @react-navigation/native
},
} |
Is there a way to prevent query parameters being written into the URL?
I am porting my React Native project to the web and I have a few screens that add a function as a parameter in
componentDidMount
. This allows a button in the header to trigger this function. When usingcreateBrowserApp
this function is written as a query parameter into the URL. Is there a way around this?The text was updated successfully, but these errors were encountered: