createStyleSheet
Utility for building your StyleSheets
with superpowers.
It can be imported from the react-native-unistyles
:
This tool is interchangeable with React Native’s StyleSheet.create
.
crateStyleSheet
accepts both object
or function
.
Basic usage (object)
If you pass an object to the createStyleSheet
it will work the same like with StyleSheet.create
.
With this tool you can now use variants, breakpoints and
media queries.
Basic usage (function)
When you pass a function to createStyleSheet
it automatically injects a theme
as the first argument for you.
To register your themes please follow setup and theming guides.
Importantly, you’ll receive the same TypeScript hints as with StyleSheet.create
!