Closed behnammodi closed 3 years ago
@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
@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 react-jss
then I created a pack
and install on our project everything works very well
@kof I found a better solution, please see this file packages/react-jss/src/createUseStyles.js
changes
@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