1.0.2 • Published 3 years ago

rn-combine-style v1.0.2

Weekly downloads
118
License
MIT
Repository
-
Last release
3 years ago

RN-Combine-Styles

A small utility that combine react native styles ✨

How to use

yarn add rn-combine-styles
import React, { useState } from "react";
import { View, StyleSheet } from "react-native";

import cs from "rn-combine-styles";

export default function Button({ text, style, disable = false, ...props }) {
  return (
    <View
      style={cs(styles.button, { color: "black" }, [(styles.disable, disable)])}
    >
      {text}
    </View>
  );
}

const styles = StyleSheet.create({
  button: {
    backgroundColor: "red",
  },
  disable: {
    backgroundColor: "blue",
  },
});