Closed EliasGit117 closed 1 year ago
are you targeting RN Web? in native environments (which is all this library aims to support), resize don't happen very often, usually only on orientation change, so it's not much of an issue. it's not like on the web where the user might grab the corner of a screen and drag to resize.
@jaredh159 okay, but in case if use it on web too, is there a way to fix it?
not something simple that's readily available in the library. you could probably add some of your own code to debounce window resize events and then possibly call into the device context somehow to re-render less frequently, but you'd have to implement that yourself, and i don't think it would be trivial. sorry. :/ once again, it's just not the use case this library is targeting, so we don't have a good answer built-in.
Well, unistyles added debounce system.
https://github.com/jpudysz/react-native-unistyles/commit/b015d7b41aa01aecbbdd8041f7701d309b1436b1
cool! maybe you could use that as an inspiration for building your own debounce wrapper for twrnc. until we change to also support RN Web, it's not something we'll be adding to the library itself. 👍
Because of changing app's size it triggers re render on each pixel size that has been changed. This sounds not really performant, can be something done with it?