So I have a stringified object in my localStorage,
const stringifiedURLObject = fromLocalStorage
I tried to JSON.parse that string to normal Url Object. and I want to convert that object into Url string,
// i want to turn this
{
pathname: 'user/[id]'
query: {
mode: 'active'
id: 'someID'
}
}
// to this
const normalPathURL = `/user/xxx?mode=active`
Then pass the string to redirect query
{
pathname: '/register',
query: {
redirect: normalPathURL,
},
}
How can i do that?
:is a bit cleaner. Regardless I would have a route helper to handle this functionality for youURLso you can do whatever you'd like with it from there