Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
@jnv/react-cosmos-wrapper-proxy
Advanced tools
Easily wrap components using react-cosmos
Supports both Wrapper Components and HOCs (Higher Order Components)
// cosmos.proxies.js
import createWrapperProxy from "react-cosmos-wrapper-proxy";
import { MuiThemeProvider, createMuiTheme } from "@material-ui/core/styles";
import purple from '@material-ui/core/colors/purple'
const muiProxy = createWrapperProxy({
// Required
component: MuiThemeProvider, // The wrapper component
fixtureKey: "mui", // Key
// Optional
// Props to pass to the wrapper component
// Note: can be passed from the fixture as well
props: {
theme: createMuiTheme({
palette: {
primary: purple
}
}),
someOtherProp: "hello"
}
});
export default [muiProxy];
// __fixtures__/example.js
export default {
component: MyComponent,
// Pass an object of props or `true` to enable the proxy
mui: true
};
// cosmos.proxies.js
import createWrapperProxy from "react-cosmos-wrapper-proxy";
import { reduxForm } from "redux-form";
const reduxFormProxy = createWrapperProxy({
// Required
component: reduxForm, // The wrapper function
hoc: true, // Differentiate it from a simple wrapper
fixtureKey: "rf" // Key
});
export default [reduxFormProxy];
// __fixtures__/example.js
export default {
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! :beers:
FAQs
Easily wrap components using react-cosmos
We found that @jnv/react-cosmos-wrapper-proxy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.