Skip to content

Commit 2f97c5c

Browse files
author
Maria Solano
committed
Add inline callback case
1 parent 4ff63b4 commit 2f97c5c

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)