1.0.2 • Published 9 years ago
rn-nested-stylesheet v1.0.2
rn-nested-stylesheet
install
λ npm install [--save/--save-dev] rn-nested-stylesheet
usage
const React = require('react');
const NestedStyleSheet = require('rn-nested-stylesheet');
const ReactNative = require('react-native');
const {
StyleSheet,
TouchableNativeFeedback,
View,
Text
} = ReactNative;
const styles = NestedStyleSheet(StyleSheet, {
container: {
flex: 1
},
button: {
button: {
borderRadius: 50
},
text: {
color: 'red'
}
}
});
const Button = function(props) {
return (
<TouchableNativeFeedback>
<View style={props.style.button}>
<Text>props.children</Text>
</View>
</TouchableNativeFeedback>
);
};
const MyComponent = function() {
return (
<View style={styles.container}>
<Button style={styles.button}>My Button!</Button>
</View>
);
};
license
MIT