storybook/docs/snippets/react/app-story-with-mock.ts.mdx
Norbert de Langen c0240f8ec5
changes
2022-06-21 18:30:05 +02:00

38 lines
793 B
Plaintext

```ts
// App.stories.ts|tsx
import React from 'react';
import type { ComponentStoryFn, ComponentMeta } from '@storybook/react';
import App from './App';
export default {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/react/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'App',
component: App,
} as ComponentMeta<typeof App>;
const Template: ComponentStoryFn<typeof App> = () => <App />;
export const Success = Template.bind({});
Success.parameters = {
fetch: {
json: {
JavaScript: 3390991,
'C++': 44974,
TypeScript: 15530,
CoffeeScript: 12253,
Python: 9383,
C: 5341,
Shell: 5115,
HTML: 3420,
CSS: 3171,
Makefile: 189,
}
}
};
```