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

fix: migrate class components to functions+hooks #3701

Merged
merged 1 commit into from
Oct 4, 2022

Conversation

stipsan
Copy link
Member

@stipsan stipsan commented Sep 30, 2022

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.

@vercel
Copy link

vercel bot commented Sep 30, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Oct 4, 2022 at 9:35AM (UTC)
1 Ignored Deployment
Name Status Preview Comments Updated
studio-workshop ⬜️ Ignored (Inspect) Oct 4, 2022 at 9:35AM (UTC)

Copy link
Member

@mariuslundgard mariuslundgard left a 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'
Copy link
Member Author

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

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

Successfully merging this pull request may close these issues.

None yet

2 participants