1.0.3-alpha.0 • Published 4 years ago

@isthatcentered/paint v1.0.3-alpha.0

Weekly downloads
3
License
ISC
Repository
-
Last release
4 years ago

paint

Merge default and override styles and classes for react component

import { StyleProps } from "@isthatcentered/paint"
import paint from "@isthatcentered/paint"


const MyComponent = (props: StyleProps<{myCustomProp: any}> ) => (
    {/* You can provide only "className" or only "style" or both, as you wish 🤗 */}
    <div {...paint({className: "a", style: {background: red}},  props)} />
)

<MyComponent
    className="a b"
    style={{color: green}}
/> // <div className="a b" style={{background: "red", color: "green"}}></div>