From 7aae55f417ba5319c5977a8f68524d581ef17675 Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Tue, 27 Aug 2024 09:46:55 +0200 Subject: [PATCH] fix: Avoid typescript error for Nextjs usePathname() (#16368) * Avoid typescript error for Nextjs usePathname() #fixes 16323 * Update Shell.tsx --------- Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> --- packages/features/shell/Shell.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/features/shell/Shell.tsx b/packages/features/shell/Shell.tsx index 1d78879fb7..7a8a7fead3 100644 --- a/packages/features/shell/Shell.tsx +++ b/packages/features/shell/Shell.tsx @@ -215,7 +215,7 @@ const useBanners = () => { const Layout = (props: LayoutProps) => { const banners = useBanners(); const pathname = usePathname(); - const isFullPageWithoutSidebar = pathname.startsWith("/apps/routing-forms/reporting/"); + const isFullPageWithoutSidebar = pathname?.startsWith("/apps/routing-forms/reporting/"); const { data: user } = trpc.viewer.me.useQuery(); const { boot } = useIntercom(); const pageTitle = typeof props.heading === "string" && !props.title ? props.heading : props.title;