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

[Optimization] Optimizing CountDown Component Deprecated React Lifecycle #358

Merged
merged 2 commits into from
Oct 15, 2023

Conversation

VampireAchao
Copy link
Contributor

issue:#341

  1. Moved initTime - Now it's a standalone function, not in the class

  2. Ditched componentWillReceiveProps - Swapped with getDerivedStateFromProps

  3. Safe State Updates - Added a tiny setTimeout in componentDidUpdate to manage state changes safely

  4. Timer Management - Ensured all timers get cleared when the component says goodbye

  5. Clean & Clear - Aimed for code that’s easy to read and understand

All cleaned up and following React's guidelines 🚀👍👀

@dengliming dengliming merged commit eece936 into apache:master Oct 15, 2023
5 checks passed
@dengliming dengliming added the type: enhancement New feature or request label Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants