storybook/docs/snippets/react/mock-context-container-global.js.mdx
2020-08-14 21:46:15 +01:00

20 lines
468 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);
```