Resize AppShell when orientation changes

This commit is contained in:
David Corbitt
2023-07-10 14:24:00 -06:00
parent 187d6492f8
commit 3f4e607e7c

View File

@@ -95,12 +95,12 @@ export default function AppShell(props: { children: React.ReactNode; title?: str
};
setHeight(); // Set the height at the start
// Listen to resize events
window.addEventListener("resize", setHeight);
window.addEventListener("orientationchange", setHeight);
// Remove event listener on cleanup
return () => {
window.removeEventListener("resize", setHeight);
window.removeEventListener("orientationchange", setHeight);
};
}, []);