useErrorBoundary and typescript exhaustive check #4124
-
If I'm using It looks as though Typescript still thinks that I put a little codesandbox together that shows the type error if I don't account for the error state. https://codesandbox.io/s/divine-microservice-n9kn3y?file=/src/FetcherComponent.tsx Is this not designed to work this way? Or is there some other way I can avoid what I think are unnecessary conditionals? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
no. we recently did something for |
Beta Was this translation helpful? Give feedback.
no. we recently did something for
initialData
, so that passing it would take away theloading
state. However, every time we do this, we need overloads, which complicates the typings. It also only works if it's passed directly to the query. WithinitialData
, that's what you'd mostly do, but withuseErrorBoundary
, you often set this globally.