Skip to content

Commit 659b432

Browse files
fix(codemod): correctly replace type of TableRow (#6468)
1 parent 65d48a5 commit 659b432

File tree

1 file changed

+7
-7
lines changed
  • packages/cli/src/scripts/codemod/transforms/v2

1 file changed

+7
-7
lines changed

packages/cli/src/scripts/codemod/transforms/v2/main.cts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -441,18 +441,18 @@ export default function transform(file: FileInfo, api: API, options?: Options):
441441
let isInteractive = false;
442442
const typeNode = type.get();
443443
if (typeNode.value.value.type === 'StringLiteral') {
444-
isInteractive = typeNode.value.value.value === 'Interactive';
444+
isInteractive = typeNode.value.value.value === 'Active';
445445
} else if (typeNode.value.value.type === 'JSXExpressionContainer') {
446446
const container = typeNode.value.value;
447447
if (container.expression.type === 'StringLiteral') {
448-
isInteractive = typeNode.value.value.expression.value === 'Interactive';
448+
isInteractive = typeNode.value.value.expression.value === 'Active';
449449
} else if (container.expression.type === 'MemberExpression') {
450450
const expr = container.expression;
451-
if (expr.object.name === 'TableMode') {
452-
if (expr.property.type === 'Identifier' && expr.property.name === 'Interactive') {
451+
if (expr.object.name === 'TableRowType') {
452+
if (expr.property.type === 'Identifier' && expr.property.name === 'Active') {
453453
isInteractive = true;
454454
}
455-
if (expr.property.type === 'StringLiteral' && expr.property.value === 'Interactive') {
455+
if (expr.property.type === 'StringLiteral' && expr.property.value === 'Active') {
456456
isInteractive = true;
457457
}
458458
}
@@ -464,9 +464,9 @@ export default function transform(file: FileInfo, api: API, options?: Options):
464464
.find(j.JSXOpeningElement)
465465
.get()
466466
.value.attributes.push(j.jsxAttribute(j.jsxIdentifier('interactive'), null));
467-
type.remove();
468-
isDirty = true;
469467
}
468+
type.remove();
469+
isDirty = true;
470470
}
471471
});
472472
}

0 commit comments

Comments
 (0)