storybook/docs/snippets/react/mock-context-container-global.js.mdx
2022-11-17 16:33:22 +01:00

21 lines
483 B
Plaintext

```js
// .storybook/preview.js
import React from 'react';
import { normal as NavigationNormal } from '../components/Navigation.stories';
import GlobalContainerContext from '../components/lib/GlobalContainerContext';
const context = {
NavigationContainer: NavigationNormal,
};
const AppDecorator = (storyFn) => {
return (
<GlobalContainerContext.Provider value={context}>{storyFn()}</GlobalContainerContext.Provider>
);
};
export const decorators = [AppDecorator];
```