react-native-multiple-styles
1.0.4 • Public • Published react-native-multiple-styles
A simple utility for handeling mutiple styles (classes) in react-native
Install with npm.
npm install react-native-multiple-styles --save
Import it to your project
import multipleStyles from 'react-native-multiple-styles'
Usage
var styles = StyleSheet.create({
icon: {
backgroundColor: 'black'
},
iconRed: {
backgroundColor: 'red'
}
});
multipleStyles(styles.icon, styles.iconRed)
multipleStyles(styles.icon, { [styles.iconRed]: true })
multipleStyles(styles.icon, { [styles.iconRed]: false })
It returns an array of the IDs representing the style objects. More info about that here.
Tests
Package Sidebar
Install
npm i react-native-multiple-styles
Weekly Downloads