How to auto-update 3rd party views?
-
If you’re using
react-native
,react-native-reanimated
, orreact-native-gesture-handler
components withstyle
prop, avoid doing anything. It will work out of the box. -
For
react-native
components withcontentContainerStyle
prop, you can use the withUnistyles factory. It will auto map this property for you. -
If you’re using third-party components and you’re confident they internally use
react-native
components, check the Babel plugin configuration to see if they can be processed to work out of the box. -
If that fails, try migrating to the withUnistyles factory. It follows best practices and ensures that only a single component is re-rendered when dependencies change. It’s also recommended to map
react-native
properties likecolor
ortrackColor
. -
If that also fails, follow best practices and use the useUnistyles hook.