Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UseQuery and related types are not exported #2295

Closed
frankandrobot opened this issue Apr 28, 2022 · 1 comment
Closed

UseQuery and related types are not exported #2295

frankandrobot opened this issue Apr 28, 2022 · 1 comment

Comments

@frankandrobot
Copy link

Use case: I'm trying to create some methods that accept query hooks as inputs and was trying to type these methods using UseQuery, UseQueryOptions, etc. But it appears that these types are not exported, and so are not available for direct consumption.

Redux toolkit version: 1.7.1

@phryneas
Copy link
Member

phryneas commented Apr 28, 2022

You can import those from dist, but they are not part of the currently exported types/official api because that makes refactoring pretty much impossible - and they are pretty much impossible to use either way, since they always require a full EndpointDefinition as type argument.

We will be exporting some additional types in #2276 - is that already enough to kind of support your use case?

PS: please note that you should never pass query hooks as props as that breaks the rules of hooks. Using them in a HOC would theoretically be possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants