How to auto-update 3rd party views?
-
If you’re using
react-nativeorreact-native-reanimatedcomponents withstyleprop, avoid doing anything. It will work out of the box. -
For
react-nativecomponents withcontentContainerStyleprop, you can use the withUnistyles factory. Wrapping your component inwithUnistyleswill auto mapcontentContainerStyleprop. -
If you’re using third-party components and you’re confident they internally use
react-nativecomponents, 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-nativeproperties likecolorortrackColor. -
If that also fails, follow best practices and use the useUnistyles hook.