For every dash in the component, a new style was created and thus
and a new object is allocated in memory which also has to be sent
over the native bridge. This is a performance intensive task
and may lead to jank.
This commit introduces the use of StyleSheet.create to create
reusable styles and stores them by an id to reference them later
for dashes with the same styling.
I tried to align as much as possible on the rules used in your project but there was no .eslintrc or something else to align on, I hope this matches your preferences.
For every dash in the component, a new style was created and thus and a new object is allocated in memory which also has to be sent over the native bridge. This is a performance intensive task and may lead to jank.
See https://facebook.github.io/react-native/docs/stylesheet.html for further information.
This commit introduces the use of StyleSheet.create to create reusable styles and stores them by an id to reference them later for dashes with the same styling.
I tried to align as much as possible on the rules used in your project but there was no .eslintrc or something else to align on, I hope this matches your preferences.