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

[ButtonBase] Derive state on render instead of in layout effects #26762

Merged
merged 2 commits into from
Jun 18, 2021

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Jun 15, 2021

Gets rid of all layout effects in ButtonBase.

This was the main offender:

// Ripple is used for user feedback (e.g. click or press) so we want to apply styles with the highest priority
useEnhancedEffect(() => {
  if (!inProp) setLeaving(true)
}, [inProp]);  

Preview: https://deploy-preview-26762--material-ui.netlify.app/components/buttons/

@mui-pr-bot
Copy link

mui-pr-bot commented Jun 15, 2021

Details of bundle changes (experimental)

Generated by 🚫 dangerJS against a60685e

@eps1lon eps1lon marked this pull request as ready for review June 15, 2021 10:55
@eps1lon
Copy link
Member Author

eps1lon commented Jun 18, 2021

This looks safe to me but @oliviertassinari might have some more historical context?

Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't remember the history of this logic. I can't trigger any regression, playing with the component.

@eps1lon eps1lon merged commit cbcf8d3 into mui:next Jun 18, 2021
@eps1lon eps1lon deleted the feat/discrete-passivenes branch June 18, 2021 10:53
@siriwatknp siriwatknp mentioned this pull request Jun 23, 2021
1 task
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.

3 participants