this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix mount/unmount states of notifications popover

+6 -6
+6 -6
src/pages/home.jsx
··· 35 35 }, []); 36 36 37 37 const notificationLinkRef = useRef(); 38 - const [menuState, setMenuState] = useState('closed'); 38 + const [menuState, setMenuState] = useState(undefined); 39 39 40 40 return ( 41 41 <> ··· 61 61 e.stopPropagation(); 62 62 if (window.matchMedia('(min-width: calc(40em))').matches) { 63 63 e.preventDefault(); 64 - setMenuState((state) => 65 - state === 'closed' ? 'open' : 'closed', 66 - ); 64 + setMenuState((state) => { 65 + console.log('state', state, !state ? 'open' : undefined); 66 + return !state ? 'open' : undefined; 67 + }); 67 68 } 68 69 }} 69 70 > ··· 72 73 <NotificationsMenu 73 74 state={menuState} 74 75 anchorRef={notificationLinkRef} 75 - onClose={() => setMenuState('closed')} 76 + onClose={() => setMenuState(undefined)} 76 77 /> 77 78 </> 78 79 } ··· 163 164 position="anchor" 164 165 align="center" 165 166 boundingBoxPadding="8 8 8 8" 166 - unmountOnClose 167 167 > 168 168 <header> 169 169 <h2>Notifications</h2>