Explorar el Código

fix isCommonInitialProps

Yuki Takei hace 2 meses
padre
commit
b050cd3f42
Se han modificado 1 ficheros con 10 adiciones y 3 borrados
  1. 10 3
      apps/app/src/pages/common-props/commons.ts

+ 10 - 3
apps/app/src/pages/common-props/commons.ts

@@ -75,11 +75,18 @@ export const isCommonInitialProps = (
 
   const p = props as Record<string, unknown>;
 
+  if ('nextjsRoutingType' in p === false) {
+    logger.warn(
+      'isCommonInitialProps: props does not have nextjsRoutingType property',
+    );
+    return false;
+  }
+
   // Essential properties validation
-  if (p.isNextjsRoutingTypeInitial !== true) {
+  if (p.nextjsRoutingType !== NextjsRoutingType.INITIAL) {
     logger.warn(
-      'isCommonInitialProps: isNextjsRoutingTypeInitial is not true',
-      { isNextjsRoutingTypeInitial: p.isNextjsRoutingTypeInitial },
+      'isCommonInitialProps: nextjsRoutingType does not equal NextjsRoutingType.INITIAL',
+      { nextjsRoutingType: p.nextjsRoutingType },
     );
     return false;
   }