Skip to content

Commit 03bcfee

Browse files
author
minwe
committed
add this.context live template
1 parent 619d63d commit 03bcfee

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,12 @@ childContextTypes: {
385385

386386
```
387387

388+
### `ctx`
389+
390+
```js
391+
this.context.$END$
392+
```
393+
388394
### `gcc`
389395

390396
```js

jetbrains-react.jar

16 Bytes
Binary file not shown.

jetbrains/templates/ReactJS.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,19 @@
479479
<option name="JS_STATEMENT" value="true" />
480480
</context>
481481
</template>
482+
<template
483+
name="ctx"
484+
value="this.context.$END$"
485+
description="this.context"
486+
toReformat="false"
487+
toShortenFQNames="true">
488+
<context>
489+
<option name="JAVA_SCRIPT" value="true" />
490+
<option name="JS_EXPRESSION" value="true" />
491+
<option name="JSX_HTML" value="true" />
492+
<option name="JS_STATEMENT" value="true" />
493+
</context>
494+
</template>
482495
<template
483496
name="gcc"
484497
value="getChildContext() {&#10; return {&#10; $START$: $END$&#10; };&#10;},&#10;"

src/template.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,11 @@ cct:
233233
variables:
234234
- {name: 'START'}
235235

236+
# this.context
237+
ctx:
238+
description: this.context
239+
tpl: this.context.$END$
240+
236241
# getChildContext
237242
gcc:
238243
description: getChildContext

0 commit comments

Comments
 (0)