Migration guide
-
Follow installation steps from Getting started guide.
-
Replace your configuration with new one.
-
Import
StyleSheet
fromreact-native-unistyles
:import { createStyleSheet, useStyles } from 'react-native-unistyles'import { StyleSheet } from 'react-native-unistyles' -
Replace
createStyleSheet
withStyleSheet.create
:const stylesheet = createStyleSheet(theme => ({const stylesheet = StyleSheet.create(theme => ({ -
Remove all occurences of
useStyles
hook:const { styles } = useStyles(stylesheet) -
Rename your
stylesheet
tostyles
:const stylesheet = StyleSheet.create(theme => ({const styles = StyleSheet.create(theme => ({