-
Notifications
You must be signed in to change notification settings - Fork 392
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
fix: migrate class components to functions+hooks #3701
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
ab1bd6c
to
53c57e9
Compare
53c57e9
to
cb78fd0
Compare
b1b4f89
to
febf7a6
Compare
cb78fd0
to
f4a72d7
Compare
f4a72d7
to
d47ef86
Compare
packages/sanity/src/form/inputs/files/ImageToolInput/imagetool/HotspotImage.tsx
Outdated
Show resolved
Hide resolved
packages/sanity/src/form/inputs/files/ImageToolInput/imagetool/ImageLoader.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
import Debug from 'debug' | ||
import {debounce} from 'lodash' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using startTransition
instead, combined with 18's Automatic State Batching
it's no longer necessary to debounce event handlers like window.onresize
d47ef86
to
dfdd446
Compare
Description
Converts problematic class components to function components with hooks to make them ready for React 18 concurrent features. With this PR there's no longer any components left in our codebase that uses
UNSAFE_
prefixed legacy lifecycle hooks.