Open klequis opened 1 month ago
Request
And maybe in here as well: https://docs.solidjs.com/solid-router/reference/primitives/use-navigate
Solid router has useNavigate and redirect. It wasn't clear to my why. I asked in Discord
useNavigate
redirect
@klequis
βββ πcategories βββ [...notfound].jsx βββ keyboards.jsx βββ mice.jsx
I want [...notfund].jsx to redirect/navigate to /products/index.jsx. Does it matter if I use redirect vs useNavigate?
[...notfund].jsx
/products/index.jsx
And got an answer from Ryan I would not have thought of:
"redirect actually only works inside cache and action functions (edited) everywhere else useNavigate"
This seems like a good add to the doc.
No response
What is this request related to?
Request
π Suggested
And maybe in here as well: https://docs.solidjs.com/solid-router/reference/primitives/use-navigate
π General description or bullet points
Solid router has
useNavigate
andredirect
. It wasn't clear to my why. I asked in Discord@klequis
I want
[...notfund].jsx
to redirect/navigate to/products/index.jsx
. Does it matter if I useredirect
vsuseNavigate
?And got an answer from Ryan I would not have thought of:
"redirect actually only works inside cache and action functions (edited) everywhere else useNavigate"
This seems like a good add to the doc.
π₯οΈ Reproduction of code samples in StackBlitz
No response