react-native-extended-stylesheet
Extend React Native StyleSheet with parameters
Installation
Installation can be done through npm
or yarn
:
npm i react-native-above-keyboard --save
yarn add react-native-above-keyboard
Usage
;;;
Pass parameters to StyleSheet.
const Button = title size = 60 <TouchableOpacity => <Text>title</Text> </TouchableOpacity>; const styles = StyleSheet
Use plain objects if you don't need to pass a parameter.
const Button = size title <TouchableOpacity => <Text>title</Text> </TouchableOpacity>; const styles = StyleSheet;
If at any point you want to access the entire styles.
const Button = size title <TouchableOpacity => <Text>title</Text> </TouchableOpacity>;
Other methods
StyleSheet.flatten
: Flattens an array of style objects, into a single style object.
License
MIT.