UnistylesRegistry can be easily replaced with StyleSheet.configure as it follows the same syntax.
Themes and Breakpoints work exactly the same.
For Settings we removed 4 out of 6 options:
Import StyleSheet from react-native-unistyles:
Replace createStyleSheet with StyleSheet.create:
Remove all occurrences of useStyles hook:
Rename your stylesheet to styles:
If you used useInitialTheme, remove it and set initial theme in StyleSheet.configure:
If you need to access your theme in component, refactor it to use withUnistyles:
If you need to access breakpoint to show/hide your components use Display and Hide components instead:
If you used UnistylesProvider, remove it as it has no effect anymore:
If you want to move your component based on keyboard position, use ime inset:
Some UnistylesRuntime methods have been renamed. Follow TypeScript types to use new names.
Some UnistylesRuntime methods have been removed:
UnistylesRuntime methods that accepted color and alpha have been changed to accept color only. Each method supports any color that is respected by React Native:
hairlineWidth has been moved from UnistylesRuntime to StyleSheet. Use StyleSheet.hairlineWidth instead:
If your app used variants, move config to styles.useVariants instead:
Style is not bound! error
If you encountered this error, it means that you’re spreading styles out of the style tag. This is not possible in Unistyles anymore as spreading will remove C++ state: