[Feature]: Allow configuration of credentials in useFetcher submit #12023
alexandesigner
started this conversation in
Proposals
Replies: 1 comment
-
Fetchers are designed to call your RR routes. They are not meant to replace |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What problem does this feature solve?
Currently, the
useFetcher
hook from React Router provides a convenient way to handle form submissions in a declarative manner. However, there is no direct way to configure options such as credentials(e.g., 'include', 'same-origin', 'omit')
when calling the submit function.This limitation makes it difficult to handle scenarios where credentials (such as cookies or authentication tokens) need to be included with the request, especially when interacting with APIs that require
credentials: 'include'
.What does the proposed API look like?
Add support for passing fetch options (specifically
credentials
) in the submit function of theuseFetcher
hook. This would allow developers to configure requests with greater flexibility when needed.Beta Was this translation helpful? Give feedback.
All reactions