-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(remix-react): detect index route from manifest in useFormAction
#3127
Conversation
e54a414
to
874e24c
Compare
useFormAction
@penspinner Could you please also add a test for this change? |
ad1aa99
to
8cca2aa
Compare
8cca2aa
to
ca58dcc
Compare
ca58dcc
to
e5ebb00
Compare
e5ebb00
to
7292444
Compare
7292444
to
ed7df53
Compare
ed7df53
to
dc03c0e
Compare
|
Awesome work @penspinner. BTW: I did fix remix flat routes to work around this issue. I append |
…ext rather than file id
…when app defines custom routes
dc03c0e
to
cec2d4a
Compare
Hi @penspinner! Are you still interested in getting this one merged? If so, please rebase onto latest |
@MichaelDeBoey This seems to have been fixed in React Router. Gonna close this. |
The
useFormAction
hook detects the file ID ending in "/index" to determine whether or not to return a form action with the?index
search param. This holds true in Remix's default route convention. However, in the case where the consumer defines custom routes, this may not hold true anymore.Testing Strategy:
I'm using the Remix Flat Routes flat-folders convention in my project.
Let's say I have a route
_auth.dashboard.index/_routes.tsx
. That's considered to be an index route in the flat-folders convention. However, rendering a<Form>
in that route results in a form with the action"/dashboard"
while the action should be"/dashboard?index"
.