Created
March 24, 2022 18:10
-
-
Save linuz90/5c5d87fb461620ccefb2ca7cc9d4cf3e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
// To install, open Command Palette, and then: Configure user snippets → New Global Snippets file | |
// Paste this snippet: | |
"Create Story": { | |
"scope": "javascript,javascriptreact,typescript,typescriptreact", | |
"prefix": "story", | |
"body": [ | |
"import { ComponentMeta } from '@storybook/react';", | |
"import React from 'react';", | |
"import ${1:componentName} from './${1:componentName}';", | |
"", | |
"export default {", | |
" title: '${1:componentName}',", | |
" component: ${1:componentName},", | |
" args: {},", | |
" decorators: [", | |
" (Story) => (", | |
" <div>", | |
" <Story />", | |
" </div>", | |
" ),", | |
" ],", | |
"} as ComponentMeta<typeof ${1:componentName}>;", | |
"", | |
"export const Default = (args) => <${1:componentName} {...args} />;" | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment