Skip to content

Commit

Permalink
refactor(codemod): improve js components migration (#3682)
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosCortizasCT authored Dec 23, 2024
1 parent 1e9e84a commit d6f5849
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down

0 comments on commit d6f5849

Please sign in to comment.