react-native-ui-lib icon indicating copy to clipboard operation
react-native-ui-lib copied to clipboard

Refactor text to optimize performance

Open ethanshar opened this issue 3 years ago • 0 comments

Description

Don't Merge, just review

I did a few things here

  • Create new hooks: useModifiers and useThemeProps - this should help us replace asBaseComponent
  • Added support in ThemeManager to set a ThemeContext - This should replace the static context type we set on UIComponent
  • Refactor Text component to a function component to use the all of the above

Due to this big change, I left with some issues I had to resolve

  • because Animated.createAnimatedComponent can't accept function components, only class components. I created a new (very) simple HOC called asClassComponent. All it does is convert a function component to a class component (we need this for very rare cases, specifically in our WheelPicker.Item component)
  • I ignored a TS issue that now appears in FloatingPlaceholder component - I couldn't figure out a solution for this. If you have ideas, do share..

Changelog

Refactor and improve Text component performance

ethanshar avatar Jul 24 '22 15:07 ethanshar