storybook/docs/snippets/react/storybook-preview-global-loader.js.mdx
2020-10-10 17:41:04 +08:00

13 lines
234 B
Plaintext

```js
// .storybook/preview.js
import React from 'react';
import fetch from 'node-fetch';
export const loaders = [
async () => ({
currentUser: (await fetch('https://jsonplaceholder.typicode.com/users/1')).json(),
}),
];
```