storybook/docs/snippets/react/mock-context-container-global.js.mdx
2021-02-23 00:26:03 +00:00

21 lines
469 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>
);
};
addDecorator(AppDecorator);
```