ecyrbe/zodios

react-hooks: Types lost when chaining imports

schoettler opened this issue · 1 comments

There seems to be strange scenarios when trying to scale filesystems...

The hook aliases seems to get lost, unless I use makeApi in every step where i'm importing the API definitions:
Screencast from 2023-08-29 06:43:25 PM.webm

Types assigned to the errors attribute on the endpoint are also lost (notice the Errors<?> inference):
image
(errors definition in the above .webm video at 0:28)

What could be happening here?

ecyrbe commented

This is normal, typescript needs to infer the template literals, this is working as designed and described in the docs.