Files
eranos/src/components/auth
shakespeare.diy bc95237b7c Fix React error #300 when logging out
The error occurred because the AccountSwitcher component was returning null while the DropdownMenu was still mounted and open. This caused React to throw a minified error #300 about invalid elements.

The fix ensures the dropdown menu is closed before removing the login, preventing the component from being unmounted while still rendering its dropdown content.

Changes:
- Added controlled state for dropdown menu (isOpen/setIsOpen)
- Created handleLogout function that closes dropdown before removing login
- Used setTimeout to ensure dropdown closes before state update

Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
2026-02-18 20:12:35 -06:00
..