Skip to content

Commit 2600829

Browse files
committed
move outside of if
1 parent 1479a1d commit 2600829

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

packages/common/refresh-runtime.js

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -576,21 +576,20 @@ export function registerExportsForReactRefresh(filename, moduleExports) {
576576
// The register function has an identity check to not register twice the same component,
577577
// so this is safe to not used the same key here.
578578
register(exportValue, filename + ' export ' + key)
579-
580-
// If it's a compound component (plain object with component properties),
581-
// also register the individual components
582-
if (
583-
isPlainObject(exportValue) &&
584-
Object.keys(exportValue).every((subKey) =>
585-
isLikelyComponentType(exportValue[subKey]),
579+
}
580+
// If it's a compound component (plain object with component properties),
581+
// also register the individual components
582+
else if (
583+
isPlainObject(exportValue) &&
584+
Object.keys(exportValue).every((subKey) =>
585+
isLikelyComponentType(exportValue[subKey]),
586+
)
587+
) {
588+
for (const subKey in exportValue) {
589+
register(
590+
exportValue[subKey],
591+
filename + ' export ' + key + '$' + subKey,
586592
)
587-
) {
588-
for (const subKey in exportValue) {
589-
register(
590-
exportValue[subKey],
591-
filename + ' export ' + key + '$' + subKey,
592-
)
593-
}
594593
}
595594
}
596595
}

0 commit comments

Comments
 (0)