Skip to content
Source
Sign inSign up
TanStack/query

v4 introduces dependency on react in core package #3542

Send to my agent
ClosedDamianOsipiuk(GitHub profile, opens in a new tab) opened this issue 4 comments

Describe the bug

In the beta branch i have noticed that hydration.ts contains reference to react types. This will introduce transitive dependency on react for vue package.

Your minimal, reproducible example

N/A

Steps to reproduce

N/A

Expected behavior

I think we need to remove react reference from core package. Maybe introducing some kind of overload in react sub-package would be a solution?

How often does this bug happen?

No response

Screenshots or Videos

No response

Platform

N/A

react-query version

v4

TypeScript version

No response

Additional context

https://github.com/tannerlinsley/react-query/blob/beta/src/core/hydration.ts#L1 https://github.com/tannerlinsley/react-query/blob/beta/src/reactjs/types.ts#L12 https://github.com/tannerlinsley/react-query/blob/beta/src/reactjs/types.ts#L18

  1. Thanks for spotting that, I think it's a mistake. The types in the core should stay the same as in v3, and the types we use in the react package, where we need the hydration (e.g. Hydrate.tsx) should just extend the base one and add the react context if needed.

    would you like to fix that for us maybe?

  2. TkDodo added labelsv4

  3. I think I'm gonna setup eslint import zones or so to prevent this mistake in the future 👍

  4. Yeah, i will try to fix it when i will have some free time.

  5. TkDodo closed this

  6. :tada: This issue has been resolved in version 4.0.0-beta.8 :tada:

    The release is available on:

    Your semantic-release bot :package::rocket:

  7. tannerlinsley added labelsreleased on @beta

Sign in to join this conversation.