We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4ff63b4 commit 2f97c5cCopy full SHA for 2f97c5c
tests/cases/fourslash/inlineVariableJsxCallback.ts
@@ -0,0 +1,35 @@
1
+/// <reference path='fourslash.ts'/>
2
+
3
+//@module: commonjs
4
+//@jsx: preserve
5
6
+// @Filename: file.tsx
7
+////function Button() {
8
+//// const onClick /**/ = () => {
9
+//// console.log("clicked");
10
+//// };
11
+////
12
+//// return (
13
+//// <button onClick={onClick}>
14
+//// Click me!
15
+//// </button>
16
+//// );
17
+////}
18
19
+goTo.marker("");
20
+verify.refactorAvailable("Inline variable");
21
+edit.applyRefactor({
22
+ refactorName: "Inline variable",
23
+ actionName: "Inline variable",
24
+ actionDescription: "Inline variable",
25
+ newContent: `function Button() {
26
27
+ return (
28
+ <button onClick={() => {
29
+ console.log("clicked");
30
+ }}>
31
+ Click me!
32
+ </button>
33
+ );
34
+}`
35
+});
0 commit comments