Блин, но у тебя как было
const isHomePage = useMemo(() => { router.pathname === '/' }, [router.pathname])
так и осталось. Где return?