You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.
Portal unmounts element based on strictmode behaviour, but not unsets refs
Value of overlayId stays old, but this overlay already destroyed and can't be updated
The expected behavior
After unmount and removing portal elements, overylayId.current should become undefined again, then it will work fine and portal will mount elements again.
React version: 18.2.0
Steps To Reproduce
The current behavior
The expected behavior
Broken code part
react-native-aria/packages/overlays/src/Portal.tsx
Line 106 in ec14df0
React 18 strict mode changes
https://reactjs.org/blog/2022/03/29/react-v18.html#new-strict-mode-behaviors
Estimated fix
useEffect(() => { return () => { if (overlayId.current) { context?.removeOverlayItem(overlayId.current); overlayId.current = undefined; } }; }, []);
The text was updated successfully, but these errors were encountered: