theme
theme copied to clipboard
0.11.4 performance improvement is also a regression
In my app I have a light and dark mode, and when that changes, I pass in an updated theme object to StyleProvider, thus re-rendering all the connected UI elements.
Unfortunately, this was broken by this commit: https://github.com/shoutem/theme/commit/5b1638e11850092dd2f02e049f0c9c155adb8398
I quite like being able to update the theme with dynamic values, and would rather handle the performance optimization myself. If that's not possible, then a forceUpdate function or something would be great.
Ah, it's actually because of a shallow equals here: https://github.com/shoutem/theme/commit/5b1638e11850092dd2f02e049f0c9c155adb8398#diff-58875160ad594f84c51eba08adcd2df7R23
Suggest using _.isEqual
Something else is preventing the UI updates, maybe in connectStyle? Can't figure it out.