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
Docs say it's recommended to set status code in action results, which I totally agree with:
But! I don't have access to the status code in my React component! actionData is well... pure data (which is ok), but even the result object of useFetcher doesn't have that.
I don't think it's aligned with web standards tbh. And it forces me to add unnecessary boilerplate, every response must be wrapped with an envelope ({ status: "error" | "ok", error, data }), which I'd prefer to avoid.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Docs say it's recommended to set status code in action results, which I totally agree with:

But! I don't have access to the status code in my React component!
actionData
is well... pure data (which is ok), but even the result object ofuseFetcher
doesn't have that.I don't think it's aligned with web standards tbh. And it forces me to add unnecessary boilerplate, every response must be wrapped with an envelope (
{ status: "error" | "ok", error, data }
), which I'd prefer to avoid.Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions