-
-
Notifications
You must be signed in to change notification settings - Fork 399
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
Keep classes ref when sheet and dynamicRules have not any change #1573
Keep classes ref when sheet and dynamicRules have not any change #1573
Conversation
ddd2db0
to
420c62a
Compare
640dee0
to
6ed69e7
Compare
@kof Thanks for review, all of them is done |
@kof This is ready to merge |
@behnammodi thanks, will look into it, in the meantime, please test it in your app in production and let me know if you notice anything |
Sure, I'll tell you |
@kof I build |
@kof I found a better solution, please see this file |
@kof This PR ready to merge and main change is: - const classes = sheet && dynamicRules ? getSheetClasses(sheet, dynamicRules) : emptyObject
+ const classes = React.useMemo(
+ () => (sheet && dynamicRules ? getSheetClasses(sheet, dynamicRules) : emptyObject),
+ [sheet, dynamicRules]
+ ) not anymore |
looks great now, thank you |
released in v10.9.0 |
What Would You Like to Add/Fix?
getSheetClasses
always return new object evensheet
anddynamicRules
haven't any changeAlso I wrote a small test to keep it in future
Todo
Expectations on Changes
So, I memoized it to prevent this behavior
Changelog
Improve performance at
useStyle