How to prevent page reload from action? #391
-
I'm using Tauri with vanilla Solid/Router and am trying to use an action to submit a form for a chat feature but the action keeps triggering a page refresh and calling the cache function? I know in (super) Beta Solid-Start, there was the I've tried using To be clear, I'm wanting to call the action on a form submit, but prevent a page refresh since I'm managing a client state for real-time updates. Am I missing something here? Help! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
and then prevent the default submit action and instead on submit do
|
Beta Was this translation helpful? Give feedback.
-
The revalidate is exposed through the response helpers now. So the action returns a response option that we basically handle through headers. See: https://github.com/solidjs/solid-router?tab=readme-ov-file#action If you don't want anything to revalidate send some garbage string through.. like In any case the page shouldn't refresh as our form handling prevents it. Unless you are handling form submit yourself in case you need to |
Beta Was this translation helpful? Give feedback.
Confirming
useAction
with no form does the same. I also confirmed the design I have is almost identical to the Strello example you posted on X today. The only diff between that app and this one is using Solid Start/Web vs. Tauri(vanilla solid/router)/Native 🤔