Skip to content

Commit 5f8df61

Browse files
committed
Add className snippet for quick insertion in components
1 parent 185bb91 commit 5f8df61

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

docs/Snippets.md

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ I.E. `tsrcc`
4444
| `cmmb→` | `comment block` |
4545
| `cp→` | `const { } = this.props` |
4646
| `cs→` | `const { } = this.state` |
47+
| `cln` | `className=""` |
4748

4849
### React
4950

src/sourceSnippets/others.ts

+9
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ type OthersMapping = {
4141
setTimeOut: 'sto';
4242
shouldComponentUpdate: 'scu';
4343
typeofSnippet: 'tpf';
44+
classNameSnippet: 'cln';
4445
};
4546

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

411+
const classNameSnippet: OthersSnippet = {
412+
key: 'classNameSnippet',
413+
prefix: 'cln',
414+
body: ["className=\"$0\""],
415+
description: "Insert className attribute"
416+
};
417+
410418
export default [
411419
exportDefault,
412420
exportDestructing,
@@ -448,4 +456,5 @@ export default [
448456
hocComponentWithRedux,
449457
hocComponent,
450458
typeofSnippet,
459+
classNameSnippet
451460
];

0 commit comments

Comments
 (0)