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: Stats and StatsGl don't remove previous class names on rerender #1994

Merged
merged 2 commits into from
Jun 15, 2024

Conversation

lukehorvat
Copy link
Contributor

Why

Both Stats and StatsGl don't remove class names set via the className prop on rerender. In the following example, if showStats is initially false and then later changes to true, the Hidden class does not get removed from the DOM element.

<Stats className={`Stats ${showStats ? '' : 'Hidden'}`} />

What

Fixed by removing the previously added class names during useEffect cleanup.

Checklist

  • Ready to be merged

Copy link

vercel bot commented Jun 14, 2024

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

Name Status Preview Comments Updated (UTC)
drei ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 14, 2024 9:35pm

Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@CodyJasonBennett CodyJasonBennett merged commit 18c24eb into pmndrs:master Jun 15, 2024
4 checks passed
Copy link

🎉 This PR is included in version 9.107.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lukehorvat lukehorvat deleted the StatsGl-classNames-cleanup branch June 16, 2024 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants