Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/Snippets.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ I.E. `tsrcc`
| `cmmb→` | `comment block` |
| `cp→` | `const { } = this.props` |
| `cs→` | `const { } = this.state` |
| `cln` | `className=""` |

### React

Expand Down
9 changes: 9 additions & 0 deletions src/sourceSnippets/others.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ type OthersMapping = {
setTimeOut: 'sto';
shouldComponentUpdate: 'scu';
typeofSnippet: 'tpf';
classNameSnippet: 'cln';
};

export type OthersSnippet = SnippetMapping<OthersMapping>;
Expand Down Expand Up @@ -407,6 +408,13 @@ const typeofSnippet: OthersSnippet = {
body: [`typeof ${Placeholders.FirstTab}`],
};

const classNameSnippet: OthersSnippet = {
key: 'classNameSnippet',
prefix: 'cln',
body: ["className=\"$0\""],
description: "Insert className attribute"
};

export default [
exportDefault,
exportDestructing,
Expand Down Expand Up @@ -448,4 +456,5 @@ export default [
hocComponentWithRedux,
hocComponent,
typeofSnippet,
classNameSnippet
];