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
in the route I also have a meta function, a component and an ErrorBoundary, everything is working fine.
Now for some reason, the blabla() function in the loader can return :
a json object, like now
a Response (from a fetch function)
So I get something like this (simplified) :
constload=async(request)=>{if(xinstanceofResponse){//I can distinguished if it's a response or not, even if this test may not work directly, that's not the problemreturnx;}else{returnjson(x);}}
My problem is that in this case (x is a Response), I would like to provide the content of the response as is, ignoring the meta function and the component.
I know it's possible to remove the meta function, error boundary and component, that will work, but of course that will break the case where x is a real json.
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.
-
Hello every one,
I have a little trouble for something I have no idea how to do.
I have a route with a loader, very basic :
in the route I also have a meta function, a component and an ErrorBoundary, everything is working fine.
Now for some reason, the
blabla()
function in the loader can return :So I get something like this (simplified) :
My problem is that in this case (x is a Response), I would like to provide the content of the response as is, ignoring the meta function and the component.
I know it's possible to remove the meta function, error boundary and component, that will work, but of course that will break the case where x is a real json.
Is there any solution for this situation ?
thank you for your help :)
Beta Was this translation helpful? Give feedback.
All reactions