theme icon indicating copy to clipboard operation
theme copied to clipboard

0.11.4 performance improvement is also a regression

Open JulianKingman opened this issue 4 years ago • 2 comments

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.

JulianKingman avatar May 15 '20 22:05 JulianKingman

Ah, it's actually because of a shallow equals here: https://github.com/shoutem/theme/commit/5b1638e11850092dd2f02e049f0c9c155adb8398#diff-58875160ad594f84c51eba08adcd2df7R23

Suggest using _.isEqual

JulianKingman avatar May 15 '20 22:05 JulianKingman

Something else is preventing the UI updates, maybe in connectStyle? Can't figure it out.

JulianKingman avatar May 15 '20 23:05 JulianKingman