diff --git a/packages/codemod/src/transforms/react-default-props-migration.ts b/packages/codemod/src/transforms/react-default-props-migration.ts index cac3c625a7..a16b06a26a 100644 --- a/packages/codemod/src/transforms/react-default-props-migration.ts +++ b/packages/codemod/src/transforms/react-default-props-migration.ts @@ -309,7 +309,10 @@ function extractDefaultPropsFromNode( defaultPropsNode: ObjectExpression ): TDefaultPropsMap { return defaultPropsNode.properties.reduce((acc, prop) => { - if (prop.type === 'ObjectProperty' && prop.key.type === 'Identifier') { + if ( + (prop.type === 'ObjectProperty' || prop.type === 'Property') && + prop.key.type === 'Identifier' + ) { return { ...acc, [prop.key.name as string]: