You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since I've migrated my action to the singleFetch approach (replace json by data or nothing), namedAction has error and useFetcher<typeof action>().data is unknown.
That's probably because namedAction returns a json response and single fetch needs to use data helper instead.
I don't think this can be fixed without breaking support for non single fetch apps.
Also I honestly don't use this helper anymore, it's simpler to just do the conditions.
let formData = await request.formData()
let intent = formData.get("intent")
if (intent === "something") {
// do something
}
if (intent === "something-else") {
// do something else
}
throw new Error(("Invalid intent") // the default in namedAction
Describe the bug
Since I've migrated my action to the singleFetch approach (replace
json
bydata
or nothing),namedAction
has error anduseFetcher<typeof action>().data
is unknown.I cannot do anymore:
When I replace this by:
I have error on the name of the action:
Here is the details of the error:
And the
useFetcher<typeof action>().data
is unknown:Your Example Website or App
n/a (maybe you don't need it for this bug?)
Steps to Reproduce the Bug or Issue
Expected behavior
That it works as it did before activating singleFetch.
Screenshots or Videos
No response
Platform
2.13.1
7.7.0
5.6.3
Additional context
I hope you will understand the problem easily, if not, tell me and I can invest more time to give you a reproduction environment 🙏.
The text was updated successfully, but these errors were encountered: