Explorar el Código

add optional chaining

yohei0125 hace 4 años
padre
commit
9699f54514
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      packages/app/src/components/PagePathHierarchicalLink.jsx

+ 3 - 1
packages/app/src/components/PagePathHierarchicalLink.jsx

@@ -40,8 +40,10 @@ const PagePathHierarchicalLink = (props) => {
   const isParentExists = linkedPagePath.parent != null;
   const isParentExists = linkedPagePath.parent != null;
   const isParentRoot = linkedPagePath.parent?.isRoot;
   const isParentRoot = linkedPagePath.parent?.isRoot;
   const isSeparatorRequired = isParentExists && !isParentRoot;
   const isSeparatorRequired = isParentExists && !isParentRoot;
+  console.log('linkedPagePathForHref', linkedPagePathForHref);
+  console.log('linkedPagePath', linkedPagePath);
 
 
-  const href = encodeURI(urljoin(basePath || '/', linkedPagePathForHref.href ?? linkedPagePath.href));
+  const href = encodeURI(urljoin(basePath || '/', linkedPagePathForHref?.href ?? linkedPagePath?.href));
 
 
   // eslint-disable-next-line react/prop-types
   // eslint-disable-next-line react/prop-types
   const RootElm = ({ children }) => {
   const RootElm = ({ children }) => {