Intro
A dynamic stylesheet for react native, support typescript.
npm install react-native-dynamic-stylesheet --save
How to use
Just like react stylesheet, but need use build
to generate stylesheet after use create
method.
const styles = DynamicStyleSheet Component { return <View style=stylescontainer></View> }
Usage
1. platform specific styles
const RNStyles = StyleSheet // is same const styles = DynamicStyleSheet
Then when application running at android device, container style flex
will be 2, ios container style flex
will be 1.
Do not need write Platform.select
anymore.
2. dynamic styles
You can pass props at build
method.
const RNStyles = StyleSheet // build stylesconst styles = DynamicStyleSheet