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

react-virtual does not support React 18 #2307

Open
vibdev opened this issue Aug 2, 2023 · 2 comments
Open

react-virtual does not support React 18 #2307

vibdev opened this issue Aug 2, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@vibdev
Copy link
Contributor

vibdev commented Aug 2, 2023

🐛 Bug Report

Canvas Kit throws a peer dependency conflict in React 18

pm WARN Conflicting peer dependency: react@17.0.2
npm WARN node_modules/react
npm WARN   peer react@"^16.6.3 || ^17.0.0" from react-virtual@2.10.4
npm WARN   node_modules/@workday/canvas-kit-react/node_modules/react-virtual
npm WARN     react-virtual@"^2.10.4" from @workday/canvas-kit-react@9.1.8
npm WARN     node_modules/@workday/canvas-kit-react

Fix

react-virtual is now @tanstack/react-virtual

updating to the new namespace should fix the issue, see:

https://github.com/TanStack/virtual/blob/623ac63988f16e6ea6755d8b2e190c123134501c/packages/react-virtual/package.json#L55-L57

@vibdev vibdev added the bug Something isn't working label Aug 2, 2023
@jaclynjessup jaclynjessup moved this to 🆕 New in Canvas Kit Aug 2, 2023
@adonaisol
Copy link

So I spent a not so insignificant amount of time looking into this yesterday to bring canvas kit to the latest version of react-virtual and it turns out, this fix is not so trivial as it looks:

  • @tanstack/react-virtual is v3 whereas react-virtual is v2. There are several breaking changes including useVirtual now becoming useVirtualizer, different signatures and behaviors. On initial glance, there seems to be a large amount of refactoring required
  • Additionally, taking into consideration that the react-virtual retyped interfaces utility exists to support exporting types from the package which this closed PR was supposed to address, I don't think I have enough context to make the necessary changes without breaking the desired implementation
  • Maybe not of so much consequence is the fact that @tanstack/react-virtual v3 is still in beta and I don't know how that would factor in the decision to upgrade
  • There doesn't seem to be a migration guide from v2 to v3 for @tanstack/react-virtual

I would also like to point out this (very recent) issue that is trying to raise awareness to the fact that a PR was created AND merged with the sole purpose of adding support for React 18 in v2 but is missing the subsequent release. The issue was raised because people were asking for a new release on the closed PR and I guess the owner doesn't check comments on closed PRs so hopefully he sees the new issue and responds one way or the other.

If a new release were to be created on v2, that would easily solve our problems so I guess for now we can just wait and see if that happens and cross our fingers? 🤷🏾 🤞🏾

@vibdev
Copy link
Contributor Author

vibdev commented Mar 25, 2024

#2663

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants