Update the navmenu title if prop is updated and undefined

This commit is contained in:
sabaimran
2024-07-24 17:41:31 +05:30
parent 4d30e5b158
commit cfe7a1068e

View File

@@ -46,6 +46,8 @@ export default function NavMenu(props: NavMenuProps) {
setIsMobileWidth(window.innerWidth < 768);
if (props.title) {
setDisplayTitle(props.title);
} else if (!props.title) {
setDisplayTitle(undefined);
}
}, [props.title]);