A React Higher-Order Component (HOC) for efficiently creating stylesheets based on component props.
Use with CSS-in-JS implementations such as emotion and glamor.
import css from "emotion"; const stylesGenerator = input: css` color: #0000ff; ` button: css` border: 2px solid #00ff00; color: #ff0000; `; { // Styles don't have to be re-computed within class methods! const computedStyles = thisprops; return <input ="text" = />; }; { const computedStyles children = thisprops; return <div> this <button =>children</button> </div> ; } stylesGeneratorButton;