Repository navigation
[Feature]: Allow configuration of credentials in useFetcher submit #12023
Replies: 2 comments
|
Fetchers are designed to call your RR routes. They are not meant to replace |
|
Closing in favor of the canonical custom-fetch proposal, being implemented in PR #15586. For Framework Mode requests to React Router's server, the proposed This does not add a Authored by an AI agent on behalf of @brophdawg11 |
Uh oh!
There was an error while loading. Please reload this page.
What problem does this feature solve?
Currently, the
useFetcherhook 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 theuseFetcherhook. This would allow developers to configure requests with greater flexibility when needed.All reactions