diff --git a/docs/Snippets.md b/docs/Snippets.md index 135e201..d09f2d0 100644 --- a/docs/Snippets.md +++ b/docs/Snippets.md @@ -44,6 +44,7 @@ I.E. `tsrcc` | `cmmb→` | `comment block` | | `cp→` | `const { } = this.props` | | `cs→` | `const { } = this.state` | +| `cln` | `className=""` | ### React diff --git a/src/sourceSnippets/others.ts b/src/sourceSnippets/others.ts index 76bf1db..6f22e18 100644 --- a/src/sourceSnippets/others.ts +++ b/src/sourceSnippets/others.ts @@ -41,6 +41,7 @@ type OthersMapping = { setTimeOut: 'sto'; shouldComponentUpdate: 'scu'; typeofSnippet: 'tpf'; + classNameSnippet: 'cln'; }; export type OthersSnippet = SnippetMapping<OthersMapping>; @@ -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, @@ -448,4 +456,5 @@ export default [ hocComponentWithRedux, hocComponent, typeofSnippet, + classNameSnippet ];