Unistyles includes custom native code, which means it does not support Expo Go.
To finish the setup use expo dev client and run prebuild command:
Library supports autolinking, to finish the setup run pod install:
Unistyles offers first-class support for React Native Web. To run the project, we recommend following the guidelines provided by Expo:
Library supports also Server Side Rendering. We recommend to setup to project with Solito:
You can also style your macOS apps using react-native-unistyles.
Please follow the instructions provided by react-native-macos and then:
Open macos/Podfile and add the following line:
Then run pod install:
2.3.0
Windows is also supported with react-native-windows package.
Simply install the package and it will be autolinked.
3. Configure Unistyles with UnistylesRegistry
Every step mentioned here is optional. If you don’t want to use theming, breakpoints, or any other setting, you don’t need to even call UnistylesRegistry.
You can jump directly into working on your components.
Remember that UnistylesRegistry should be called only once. If you want to interact with Unistyles use UnistylesRuntime as described here.
3.1 Define your breakpoints
You can name your breakpoints however you like. The only restriction is that the first breakpoint must start with 0:
3.2 Define your theme(s)
You can define as many themes as you want. Each theme just needs to have a unique name and the same type.
The library has no restrictions on the shape of the theme. You can use nested objects, functions, spread operators, and so on.
3.3 Configure TypeScript
If you’re using TypeScript, create types for your breakpoints and/or themes.
This step is required to achieve perfect Intellisense support across all StyleSheets.
3.4 Call UnistylesRegistry
The final step is to call UnistylesRegistry to pass your themes, breakpoints and optional config.
Optional config
UnistylesRegistry has a method called addConfig that let’s you use some cool additional features.
List of all available settings can be found here.