ecyrbe / zodios

typescript http client and server with zod validation

Home Page:https://www.zodios.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-hooks: Types lost when chaining imports

schoettler opened this issue · 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?

commented

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