ThemeProvider
In version 0.2 all you need to do is use the ThemeProvider
to wrap your application to control the theme, because Rapi UI now have dark mode!
This component will preload the Ubuntu Fonts and @expo/vector-icons
put this in your App.js or your root component, and will return a boolean
to tell you if your assets are ready or not.
#
UsageNote: this component already have <SafeAreaProvider/>
wrapper
#
Caching Images and fontsAssets are cached differently depending on where they're stored and how they're used. This guide offers best practices for making sure you only download assets when you need to. In order to keep the loading screen visible while caching assets, it's also a good idea to render AppLoading
and only that component until everything is ready. the loading
prop will render a custom loading if you fill it.
#
Properties#
Propertiesprops | required | value | Default Value |
---|---|---|---|
ViewProps | |||
theme | No | light / dark | light |
setTheme | Yes | setTheme | |
images | No | [image,image...] | |
fonts | No | {font, font...} | |
loading | No | React.ReactNode | null |