Fetcher behaviour when used conditionally in a modal #13001
Unanswered
discoverlance-com
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am using fetcher in a datatable to render a delete modal when the user selects items in the table. The delete button to trigger the modal only shows up after the items in the datatable has been selected.
I am then using fetcher in the modal to create a post request to another route (resource route with only an action) where I return data with a different status and error messages.
For some reason, the form does not use fetcher but does a full page reload or full page form submission and then after the submission, it also redirects me to the resource action page which has no component to render as it's only purpose is to export an action that can be used by the fetcher.
Since I am using fetcher.Form, I only specify the action in the form to be a different route. I am still not sure why it uses a full browser reload (the favicon spins) to submit the form and also redirects to the action or makes a get request to it afterwards.
This is my dialog/use of fetcher:
And this is my hook where I use fetcher:
And this is my action
Does anyone have an idea as to why this is happening?
Beta Was this translation helpful? Give feedback.
All reactions