Issue
I have been looking through Remix docs, but I can't find the answer to this. It seams that you can't redirect from action if you are using Form component from remix. Here is a stackblitz, take a look:
Here I have two child route with forms: first/form route contains Form component, and first/another-form route contains simple HTML form tag. When we you hit a submit button in both forms, you should be redirected to parent route, redirect doesn't work from route with Form component.
What is wrong? What do I missing here?
Solution
I think it may be an issue with StackBlitz. I see that Remix is calling the action and returns a 204 response (which is for client-redirect). However, the actual fetch call in the browser is not returning... stays in (pending) until it times out. Are you seeing this same problem on your local app?
Here's the same example on Codesandbox and it works just fine as expected.
https://codesandbox.io/s/remix-form-redirect-62pgtl
Answered By - Kiliman
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.