react-cosmos-wrapper-proxy
Easily wrap components using react-cosmos
Supports both Wrapper Components and HOCs (Higher Order Components)
Examples
Wrapper
Using Material-UI
// cosmos.proxies.js;;; const muiProxy = ; muiProxy;
// __fixtures__/example.js component: MyComponent // Pass an object of props or `true` to enable the proxy mui: true // Or if `defaultEnabled` is set, selectively disable it mui: false;
HOC
Using Redux-Form
// cosmos.proxies.js;; const reduxFormProxy = ; reduxFormProxy;
// __fixtures__/example.js component: MyComponent // If HOC looks like myHoc(arg1, arg2)(Component) // Then pass an array of arguments rf: form: 'formName' // If the HOC is simply myHoc(Component) // Then just pass true rf: true;
Contributions are more than welcome! 🍻