Replies: 2 comments
-
Bump. As far as I can tell this is still unsupported. |
Beta Was this translation helpful? Give feedback.
0 replies
-
3 years later, also wondering about this! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In
useSWR
I can declare the type of the data returned withuseSWR<Sale[], Error>
..However, I couldn't find a way to tell the middleware I configured via
{ use: [salesMiddleware] }
which I am using to transform part of the data fetched.I just declared it as:
but I couldn't find any way to override the declaration for the data. After several attempts at typecasting the data inside the middleware function, which looks awful, I ended up with
// @ts-ignore
, which is not quite the proper thing to do but, by the time being, it looks less awful than all the messy type casting here and there.BTW: it might be nice to add typings to the examples for the middleware .
Thanks in advance for the help.
Beta Was this translation helpful? Give feedback.
All reactions