@@ -75,18 +75,18 @@ export class ClerkHostRenderer extends React.PureComponent<
7575 // Remove children and customPages from props before comparing
7676 // children might hold circular references which deepEqual can't handle
7777 // and the implementation of customPages relies on props getting new references
78- const prevProps = without ( _prevProps . props , 'customPages' , 'customMenuItems' , 'children' ) ;
79- const newProps = without ( this . props . props , 'customPages' , 'customMenuItems' , 'children' ) ;
78+ const prevProps = without ( _prevProps . props || { } , 'customPages' , 'customMenuItems' , 'children' ) ;
79+ const newProps = without ( this . props . props || { } , 'customPages' , 'customMenuItems' , 'children' ) ;
8080
8181 // instead, we simply use the length of customPages to determine if it changed or not
82- const customPagesChanged = _prevProps . props . customPages ?. length !== this . props . props . customPages ?. length ;
82+ const customPagesChanged = _prevProps . props ? .customPages ?. length !== this . props . props ? .customPages ?. length ;
8383 const customMenuItemsChanged =
84- _prevProps . props . customMenuItems ?. length !== this . props . props . customMenuItems ?. length ;
84+ _prevProps . props ? .customMenuItems ?. length !== this . props . props ? .customMenuItems ?. length ;
8585
8686 // Strip out mountIcon and unmountIcon handlers since they're always generated as new function references,
8787 // which would cause unnecessary re-renders in deep equality checks
88- const prevMenuItemsWithoutHandlers = stripMenuItemIconHandlers ( _prevProps . props . customMenuItems ) ;
89- const newMenuItemsWithoutHandlers = stripMenuItemIconHandlers ( this . props . props . customMenuItems ) ;
88+ const prevMenuItemsWithoutHandlers = stripMenuItemIconHandlers ( _prevProps . props ? .customMenuItems ) ;
89+ const newMenuItemsWithoutHandlers = stripMenuItemIconHandlers ( this . props . props ? .customMenuItems ) ;
9090
9191 if (
9292 ! isDeeplyEqual ( prevProps , newProps ) ||
0 commit comments