Rewrite useFormAction to respect basename #23
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Not a lot of creative coding was done here, I just copied how
react-router-dom
implementsuseFormAction
and adapted it to svelte.Running
yarn validate
cypress gets stuck onnot sure what's up with that.
This same code inside my repo that uses react-router-svelte (directly in node_modules) fixes the problem described in this issue #22
Please verify all tests pass properly.
Link to
useFormAction
inreact-router-dom
for verification:https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/index.tsx#L873
Also link to
useResolvedPath
inreact-router-dom
where I copied howresolveTo
is used:https://github.com/remix-run/react-router/blob/bf5afbed559926ed35ac9180881c78c426a29230/packages/react-router/lib/hooks.tsx#L271