storybook/docs/snippets/react/storybook-preview-global-loader.js.mdx
2021-02-23 00:26:03 +00: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(),
}),
];
```