-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypescriptreact.json
69 lines (69 loc) · 1.4 KB
/
typescriptreact.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{
"Starter React Typescript file": {
"body": [
"interface ItemProps {",
"/** Prop description. */",
"propName?: string;",
"}",
"$2",
"/** JSDoc description for the item. [Documentation]() */",
"export default function Item({",
"propName,",
"}: ItemProps) {",
"return (",
"<div>{propName}",
"Item",
"</div>",
");",
"}",
"$2",
"Item.displayName = 'Item';",
"$2"
],
"description": "Create a new React file",
"prefix": "starter"
},
"Starter React Typescript story file": {
"body": [
"import type { Meta, StoryObj } from '@storybook/react';",
"$2",
"import Item from './Item';",
"$2",
"const meta = {",
"component: Item,",
"title: 'Components/Item',",
"} satisfies Meta<typeof Item>;",
"$2",
"export default meta;",
"type Story = StoryObj<typeof meta>;",
"$2",
"export const Primary: Story = {",
"args: {",
"propName: 'string'",
"},",
"};"
],
"description": "Create a new storybook file",
"prefix": "story"
},
"React map": {
"body": [
"{keys && keys.map((props, index) => <Key {...props} key={index} />)}"
],
"description": "Creates a React map",
"prefix": "map"
},
"Create react element": {
"body": [
"{React.createElement(",
"element,",
"classNames,",
"<>",
"</>",
")",
"}"
],
"description": "Sets up the create React element",
"prefix": "create react element"
}
}