We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 208e9a6 commit 00a0e3fCopy full SHA for 00a0e3f
typescript/src/codeActions/functionExtractors.ts
@@ -1,3 +1,4 @@
1
+import { equals } from 'rambda'
2
import { GetConfig } from '../types'
3
import {
4
createDummySourceFile,
@@ -113,10 +114,13 @@ export const handleFunctionRefactorEdits = (
113
114
...textChanges.slice(0, -2),
115
{
116
...insertChange,
- newText: `<${componentName} ${args
117
- .split(', ')
118
- .map(identifierText => `${identifierText}={${identifierText}}`)
119
- .join(' ')} />`,
+ newText: `<${componentName}${
+ args &&
+ ` ${args
120
+ .split(', ')
121
+ .map(identifierText => `${identifierText}={${identifierText}}`)
122
+ .join(' ')}`
123
+ } />`,
124
},
125
126
span: functionChange.span,
0 commit comments