|
2 | 2 | "Component Skeleton": { |
3 | 3 | "prefix": "component", |
4 | 4 | "body": [ |
5 | | - "import * as React from 'react';", |
| 5 | + "import React from 'react';", |
6 | 6 | "import { PickDefaultProps } from '@sandstormmedia/react-redux-ts-utils';", |
7 | 7 | "\r", |
8 | 8 | "//", |
9 | 9 | "// Props", |
10 | 10 | "//", |
11 | | - "interface ${1:ComponentName}Props {", |
| 11 | + "type ${1:ComponentName}Props = Readonly<{", |
12 | 12 | "\ttemplate: string;", |
13 | | - "}", |
| 13 | + "}>;", |
14 | 14 | "\r", |
15 | 15 | "type DefaultProps = PickDefaultProps<${1:ComponentName}Props, 'template'>;", |
16 | 16 | "\r", |
|
21 | 21 | "//", |
22 | 22 | "// State", |
23 | 23 | "//", |
24 | | - "interface ${1:ComponentName}State {", |
| 24 | + "type ${1:ComponentName}State = Readonly<{", |
25 | 25 | "\tisCool: boolean;", |
26 | | - "}", |
| 26 | + "}>;", |
27 | 27 | "\r", |
28 | 28 | "const initialState: ${1:ComponentName}State = {", |
29 | 29 | "\tisCool: true,", |
|
55 | 55 | "Container Skeleton": { |
56 | 56 | "prefix": "container", |
57 | 57 | "body": [ |
58 | | - "import * as React from 'react';", |
| 58 | + "import React from 'react';", |
59 | 59 | "import { connect } from 'react-redux';", |
60 | 60 | "\r", |
61 | 61 | "import { actions, ApplicationState, selectors } from '../../Redux/Store';", |
|
80 | 80 | "Storybook Story Skeleton": { |
81 | 81 | "prefix": "story", |
82 | 82 | "body": [ |
83 | | - "import { action } from '@storybook/addon-actions';", |
| 83 | + "import React from 'react';", |
84 | 84 | "import { storiesOf } from '@storybook/react';", |
85 | | - "import * as React from 'react';", |
| 85 | + "import { action } from '@storybook/addon-actions';", |
86 | 86 | "\r", |
87 | 87 | "import ${1:ComponentName} from '.';", |
88 | 88 | "\r", |
|
97 | 97 | "Component Test Skeleton": { |
98 | 98 | "prefix": "test", |
99 | 99 | "body": [ |
100 | | - "import * as React from 'react';", |
101 | | - "import { render } from 'react-dom';", |
102 | | - "import * as ReactTestRenderer from 'react-test-renderer';", |
| 100 | + "import React from 'react';", |
| 101 | + "import ReactDOM from 'react-dom';", |
| 102 | + "import ReactTestRenderer from 'react-test-renderer';", |
103 | 103 | "\r", |
104 | 104 | "import ${1:ComponentName} from '.';", |
105 | 105 | "\r", |
106 | 106 | "describe('${1:ComponentName} tests', () => {", |
107 | 107 | "\tit('should render without crashing', () => {", |
108 | | - "\t\trender(<${1:ComponentName} />, document.createElement('div'));", |
| 108 | + "\t\tconst div = document.createElement('div');", |
| 109 | + "\t\tReactDOM.render(<${1:ComponentName} />, div);", |
| 110 | + "\t\tReactDOM.unmountComponentAtNode(div);", |
109 | 111 | "\t});", |
110 | 112 | "\r", |
111 | 113 | "\tit('should match snapshot', () => {", |
|
0 commit comments