Skip to content

Instantly share code, notes, and snippets.

@ChrisLowe-Takor
Created December 7, 2020 09:05
Show Gist options
  • Save ChrisLowe-Takor/e5c7e755da32332d4168f1a658da4b12 to your computer and use it in GitHub Desktop.
Save ChrisLowe-Takor/e5c7e755da32332d4168f1a658da4b12 to your computer and use it in GitHub Desktop.
React Storybook snippet
"Storybook": {
"prefix": "rstory",
"body": [
"import React from 'react';",
"import { Story, Meta } from '@storybook/react/types-6-0';",
"import { Provider } from 'react-redux';",
"import store from '../../../../store/store';",
"",
"export default {",
" title: '$1'",
"} as Meta;",
"",
"const $1Story: Story = () => {",
" return (",
" <Provider store={store}>",
" <MyComponent />",
" </Provider>",
" )",
"}",
"",
"$1Story.storyName = \"My Story\";",
"",
"export const $1 = $1Story.bind({});"
],
"description": "Storybook"
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment