-
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
Action in root.tsx not executed when pathless index route present #2498
Comments
Note:
|
Yeah, when Remix posts to a route, it looks for an action on that route. If you're on an index route, it will look at the parent layout for an action unless you include |
Thanks for explaining what's going wrong here. From a DX point of view I would expect that the action is always triggered in the same location where I define the |
Quote from the docs:
Thus I hope this issue will be fixed. |
This breaks the principle of least surprise. IMO, matched routes should have their If the index route doesn't export an If both the index route AND the parent export an |
Here this is mentioned in passing: https://remix.run/docs/en/v1/api/remix#form-action |
I think this is the same bug as this issue over in react router. Pathless routes should be ignored when matching for actions, so |
🤖 Hello there, We just published version Thanks! |
Should be fixed now that Remix sits on top of RR. |
What version of Remix are you using?
1.3.3
Steps to Reproduce
Install
git clone https://github.com/styxlab/remix-issue-root-action
cd remix-issue-root-action
yarn
yarn dev
Reproduce
Enter a text into the text field and press enter => Error: 405 Method Not Allowed
Expected Behavior
No error. The action in
root.tsx
should be executed.Actual Behavior
Error: 405 Method Not Allowed
The text was updated successfully, but these errors were encountered: