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

VirtualList uses deprecated React method #2111

Closed
snorrees opened this issue Nov 8, 2020 · 3 comments
Closed

VirtualList uses deprecated React method #2111

snorrees opened this issue Nov 8, 2020 · 3 comments
Labels

Comments

@snorrees
Copy link
Contributor

snorrees commented Nov 8, 2020

Describe the bug

react-tiny-virtual-list implement componentWillReceiveProps. It is used by InfiniteList.

This emits a console warning when using Use React 17 with Sanity 2.0.9.

To Reproduce
Use React 17 with Sanity 2.0.9.

Open console:

Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details.

* Move data fetching code or side effects to componentDidUpdate.
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state
* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.

Please update the following components: VirtualList

Expected behavior

No warnings in browser console when starting Sanity using React 17.

Which versions of Sanity are you using?

@sanity/cli 2.0.9 (up to date)
@sanity/base 2.0.9 (up to date)
@sanity/block-content-to-react 2.0.7 (up to date)
@sanity/client 2.0.9 (up to date)
@sanity/components 2.0.9 (up to date)
@sanity/core 2.0.9 (up to date)
@sanity/dashboard 2.0.9 (up to date)
@sanity/default-layout 2.0.9 (up to date)
@sanity/default-login 2.0.9 (up to date)
@sanity/desk-tool 2.0.9 (up to date)
@sanity/form-builder 2.0.9 (up to date)
@sanity/production-preview 2.0.5 (up to date)
@sanity/vision 2.0.9 (up to date)

What operating system are you using?
Windows

Which versions of Node.js / npm are you running?
npm: 6.14.8
node: v14.15.0

Additional context
"react": "^17.0.1",
"react-dom": "^17.0.1"

@snorrees snorrees changed the title VirtualList uses deprecated React features. VirtualList uses deprecated React features Nov 8, 2020
@snorrees snorrees changed the title VirtualList uses deprecated React features VirtualList uses deprecated React method Nov 8, 2020
@snorrees snorrees changed the title VirtualList uses deprecated React method InfiniteList uses deprecated React method Nov 8, 2020
@snorrees snorrees changed the title InfiniteList uses deprecated React method VirtualList uses deprecated React method Nov 8, 2020
@roffelsaurus
Copy link

roffelsaurus commented Nov 13, 2020

Not completely sure how it worked before, but adding new documents does not scroll to the new item. Could be related.

The downstream dependency seems to be a zombie: clauderic/react-tiny-virtual-list#81

@adrian-beston
Copy link

Still getting the same console warning for VirtualList with Sanity 2.14 and React 17.0.2

@RitaDias RitaDias added the bug label Dec 15, 2022
@kmelve
Copy link
Member

kmelve commented Jan 11, 2023

Hi!

We are currently working on improving our workflows and follow-up on our open GitHub repository. In that work, we have decided to close most issues older than the release of Sanity Studio v3.

We value your feedback, so if this issue is still important to you and relevant for Sanity Studio v3, please search for relevant open issues. If you can’t find any, open a new one and link to relevant comments in this thread. For questions about how to do something, please post them in the slack community.

@kmelve kmelve closed this as completed Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants