Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
@crazyfactory/storybook-props-mock-addon
Advanced tools
It will generate translation based on `translation` prop's keys.
translation
can be mocked for nowIt will generate translation based on translation
prop's keys.
webpack.config.js
loader: path.resolve('./node_modules/@crazyfactory/storybook-props-mock-addon/lib/reactTypescriptTranslationLoader.js')
config.js
import {withMockedTranslation} from "@crazyfactory/storybook-props-mock-addon/lib/withMockedTranslation";
addDecorator(withMockedTranslation());
story files
export const Simple = ({mockedTranslation}) => (
// pass mockedTranslation to translation prop
);
CustomerInfo.tsx
import * as React from "react";
interface IProps {
firstName: string;
lastName: string;
translation: {
firstName: string;
lastName: string;
}
}
export class CustomerInfo extends React.Component<IProps> {
public render(): JSX.Element {
const {firstName, lastName, translation} = this.props;
return (
<div>
<div>
{translation.firstName}: {firstName}
</div>
<div>
{translation.lastName}: {lastName}
</div>
</div>
);
}
}
CustomerInfo.stories.tsx
import * as React from "react";
import {CustomerInfo} from "./CustomerInfo";
export default {
component: CustomerInfo,
title: "CustomerInfo"
}
export const Simple = ({mockedTranslation}) => (
<CustomerInfo firstName={"John"} lastName={"Lee"} translation={mockedTranslation}/>
);
Then run storybook, the addon will generate translation for you by pascalizing translation keys
FAQs
It will generate translation based on `translation` prop's keys.
The npm package @crazyfactory/storybook-props-mock-addon receives a total of 1 weekly downloads. As such, @crazyfactory/storybook-props-mock-addon popularity was classified as not popular.
We found that @crazyfactory/storybook-props-mock-addon demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 open source maintainers 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
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
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.