rn-nested-stylesheet

1.0.2 • Public • Published

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

Package Sidebar

Install

npm i rn-nested-stylesheet

Weekly Downloads

0

Version

1.0.2

License

MIT

Last publish

Collaborators

  • ramitos