react-scrap
A utility for quickly creating hassle-free React components with class names managed by the JedWatson/ClassNames module.
Install
npm install react-scrap
API
Takes a base component, any number of static class names as strings or objects, and an optional dynamic class name render function that receives props and returns any number of dynamic class names.
Example
;;; const Button = ; const PirateButton = ; { return <div> <Button type="primary" disabled> Press Me <Button> <PirateButton type="danger"> YARR! </PirateButton> </div> ;} ReactDOM;
renders into:
Press Me YARR!