S
SolidJS2mo ago
Eatham

`useNavigate` inside an `action`?

I am trying to use useNavigate in an action when my form is submitted. However my page isn't navigating. No errors appear in console.
const some_action = action(async (data) => {useNavigate()("/")})

...
<form action={some_action}>
const some_action = action(async (data) => {useNavigate()("/")})

...
<form action={some_action}>
2 Replies
TaQuanMinhLong
TaQuanMinhLong2mo ago
i think in action you can just throw redirect instead https://docs.solidjs.com/solid-router/reference/data-apis/action
Eatham
EathamOP2mo ago
Thanks
Want results from more Discord servers?
Add your server