File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ export const Toggle: React.FunctionComponent<Props> = ({
5959
6060 useEffect ( ( ) => {
6161 if (
62+ clickedItem &&
6263 clickedItem . scroll &&
6364 clickedItem . state &&
6465 clickedItem . label === label
@@ -80,15 +81,15 @@ export const Toggle: React.FunctionComponent<Props> = ({
8081
8182 // for collapsing items in container when container will collapse
8283 if (
83- ! clickedItem . state &&
84+ ! ( clickedItem && clickedItem . state ) &&
8485 ITEM_LABELS_VALUES . toString ( ) . includes ( label ) &&
8586 clickedItem . label === inContainer ( label as ITEM_LABELS )
8687 ) {
8788 setExpanded ( false ) ;
8889 return ;
8990 }
9091
91- if ( ! expanded && clickedItem . state && label ) {
92+ if ( ! expanded && clickedItem && clickedItem . state && label ) {
9293 // for container when hash will change
9394 if (
9495 clickedItem . label === label &&
You can’t perform that action at this time.
0 commit comments