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

[styles] Follow react docs for firstRender flag #13607

Merged
merged 5 commits into from
Feb 19, 2019

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Nov 15, 2018

This was something where the intention of the code was not apparent to me and looked like it was using useState not for its intended purpose. Turns out the react docs already had this use case in mind: https://reactjs.org/docs/hooks-faq.html#can-i-run-an-effect-only-on-updates

@eps1lon eps1lon added the package: styles Specific to @mui/styles. Legacy package, @material-ui/styled-engine is taking over in v5. label Nov 15, 2018
@oliviertassinari oliviertassinari added the on hold There is a blocker, we need to wait label Nov 16, 2018
@oliviertassinari
Copy link
Member

oliviertassinari commented Nov 16, 2018

Let's wait the 100% test coverage before merging this pull request. I also want to see the peformance implication.

@oliviertassinari oliviertassinari self-assigned this Feb 16, 2019
@mbrookes mbrookes changed the base branch from master to next February 16, 2019 22:25
eps1lon and others added 3 commits February 19, 2019 10:25
We only need to change that value once. Every subsequent
effect will be a noop anyways.
@oliviertassinari oliviertassinari force-pushed the refactor/styles/cleanup-makestyles branch from ba6fb2a to 3efbb48 Compare February 19, 2019 10:11
@oliviertassinari oliviertassinari added new feature New feature or request and removed on hold There is a blocker, we need to wait labels Feb 19, 2019
@oliviertassinari oliviertassinari merged commit 8a336c6 into mui:next Feb 19, 2019
@oliviertassinari
Copy link
Member

oliviertassinari commented Feb 19, 2019

@eps1lon It looks more idiomatic than my setstate hack, well-spotted :).

@eps1lon eps1lon deleted the refactor/styles/cleanup-makestyles branch September 14, 2021 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request package: styles Specific to @mui/styles. Legacy package, @material-ui/styled-engine is taking over in v5.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants