ecyrbe / zodios

typescript http client and server with zod validation
https://www.zodios.org/
MIT License
1.71k stars 46 forks source link

React hook can not be auto-completed #150

Closed QzCurious closed 2 years ago

QzCurious commented 2 years ago

Problem

A sample codesandbox for demonstrating the bug image

And note that, following the doc, I installed @tanstack/react instead of react-query.

Possible Solution

A simple solution is to install react-query@3.

But maybe this library should use @tanstack/react instead. image

Sorry I can't locate the right spot for the breaking code. And also, I can't figure out how this library were importing react-query. It's even not marked as a dependency in package.json. Hope the provided information is enough.

ecyrbe commented 2 years ago

Yes, zodios has a dependency on react-query V3. Support for react query v4 will come from another package soon.

ecyrbe commented 2 years ago

i fixed documentation to tell to install react-query. sorry for the inconvenience.

After discussion with react-query maintainer, i settled to upgrade to react-query v4 in next major version of zodios. So in the mean time, install react-query.

documentation : http://www.zodios.org/docs/installation#with-react