Skip to content

Instantly share code, notes, and snippets.

@Vivek205
Created December 30, 2019 09:46
Show Gist options
  • Save Vivek205/671182c1be5747fb9701b8fb2f0019d1 to your computer and use it in GitHub Desktop.
Save Vivek205/671182c1be5747fb9701b8fb2f0019d1 to your computer and use it in GitHub Desktop.
src/stories/
import React from "react";
import { addDecorator } from "@storybook/react";
import ProviderWrapper from "./Providers";
import MuiTheme from "../assets/MuiTheme";
const withProviders = story => <ProviderWrapper theme={MuiTheme}>{story()}</ProviderWrapper>;
addDecorator(withProviders);
import React from "react";
import { ThemeProvider as MuiThemeProvider } from "@material-ui/styles";
const ProviderWrapper = ({ children, theme }) => <MuiThemeProvider theme={theme}>{children}</MuiThemeProvider>;
export default ProviderWrapper;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment