Closed MoSattler closed 10 months ago
As a temporary fix I have done this in my-parent.$someParam.my-child._index.tsx
:
export { action } from "#my-parent.$someParam.my-child"
As I stated in https://github.com/remix-run/react-router/issues/11024 this is how Remix works.
As I stated in remix-run/react-router#11024 this is how Remix works.
Not quite, it is a bug in remix.
Hey, I posted the same issue in the remix repo (https://github.com/remix-run/react-router/issues/11024), but someone mentioned this could be an issue with the flat-route package as well. I am using
"remix-flat-routes": "^0.6.2"
.What version of Remix are you using?
2.2.0
Are all your remix dependencies & dev-dependencies using the same version?
Steps to Reproduce
I have a layout route on
my-parent.$someParam.tsx
which adds a form and a action to handle the form.inside that route there are three children:
my-parent._index.tsx
my-parent.$someParam.my-child.tsx
my-parent.$someParam.my-child._index.tsx
Now, when I am submitting the form on
/my-parent/some-value/my-child
, everything works as expected.But if I am on
/my-parent/some-value/my-child?index
, and I try submit, I get the following error:Expected Behavior
Forms should always submit to the action in their route, not some other route
Actual Behavior
For some reason, if i am on the
?index
path of some child route, actions of parent layout routes also try to post on their respective index routes