-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Updates for Remix on RR 6.4 #9664
Changes from 2 commits
dc5dddf
e2f0cca
3fce264
cdbaa27
e5d0803
c9e6851
34ee733
f188645
e8d5340
99993d9
e3b31d0
470082b
239bc7c
13a0b4f
ecbca64
09209b6
a5e45d7
6c69af5
9c3548f
80a50b1
6239420
4066857
8ab846b
bb40a35
71d7b2f
2da3b2c
c3642e0
86699a1
10b6c5b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -245,5 +245,5 @@ export function getFormSubmissionInfo( | |
let { protocol, host } = window.location; | ||
let url = new URL(action, `${protocol}//${host}`); | ||
|
||
return { url, method, encType, formData }; | ||
return { url, method: method.toLowerCase(), encType, formData }; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lowercase incoming methods, since |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -650,7 +650,14 @@ const FormImpl = React.forwardRef<HTMLFormElement, FormImplProps>( | |
let submitter = (event as unknown as HTMLSubmitEvent).nativeEvent | ||
.submitter as HTMLFormSubmitter | null; | ||
|
||
submit(submitter || event.currentTarget, { method, replace, relative }); | ||
let submitMethod = | ||
(submitter?.formMethod as FormMethod | undefined) || method; | ||
|
||
submit(submitter || event.currentTarget, { | ||
method: submitMethod, | ||
replace, | ||
relative, | ||
}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same fix Remix used to ensure we allow |
||
}; | ||
|
||
return ( | ||
|
@@ -916,10 +923,9 @@ export function useFormAction( | |
invariant(routeContext, "useFormAction must be used inside a RouteContext"); | ||
|
||
let [match] = routeContext.matches.slice(-1); | ||
let resolvedAction = action ?? "."; | ||
// Shallow clone path so we can modify it below, otherwise we modify the | ||
// object referenced by useMemo inside useResolvedPath | ||
let path = { ...useResolvedPath(resolvedAction, { relative }) }; | ||
let path = { ...useResolvedPath(action ? action : ".", { relative }) }; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove |
||
|
||
// Previously we set the default action to ".". The problem with this is that | ||
// `useResolvedPath(".")` excludes search params and the hash of the resolved | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See
??
removal below - added a lint rule to prevent that showing up again