The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
remove force-static
Steven Teyb403a43256a6
diff --git a/apps/web/app/admin.dub.co/(dashboard)/layout.tsx b/apps/web/app/admin.dub.co/(dashboard)/layout.tsxindex 8858a8753f..0bdbdb1e8a 100644--- a/apps/web/app/admin.dub.co/(dashboard)/layout.tsx+++ b/apps/web/app/admin.dub.co/(dashboard)/layout.tsx@@ -4,7 +4,6 @@ import Providers from "app/providers";import Link from "next/link";import { ReactNode } from "react";-export const dynamic = "force-static";export const metadata = constructMetadata({ noIndex: true });const tabs = [diff --git a/apps/web/app/app.dub.co/(dashboard)/layout.tsx b/apps/web/app/app.dub.co/(dashboard)/layout.tsxindex b5361a442d..6a6d208aac 100644--- a/apps/web/app/app.dub.co/(dashboard)/layout.tsx+++ b/apps/web/app/app.dub.co/(dashboard)/layout.tsx@@ -5,7 +5,6 @@ import { constructMetadata } from "@dub/utils";import { ReactNode } from "react";import Providers from "../../providers";-export const dynamic = "force-static";export const metadata = constructMetadata();export default async function Layout({ children }: { children: ReactNode }) {diff --git a/apps/web/ui/layout/sidebar/sidebar-nav.tsx b/apps/web/ui/layout/sidebar/sidebar-nav.tsxindex 58d26f5c22..ec5e075718 100644--- a/apps/web/ui/layout/sidebar/sidebar-nav.tsx+++ b/apps/web/ui/layout/sidebar/sidebar-nav.tsx@@ -8,7 +8,6 @@ import {PropsWithChildren,ReactNode,Suspense,- useEffect,useMemo,useState,} from "react";@@ -109,13 +108,12 @@ function NavItem({ item }: { item: NavItemType }) {const { name, icon: Icon, href, exact } = item;const [hovered, setHovered] = useState(false);- const [isActive, setIsActive] = useState(false);const pathname = usePathname();- useEffect(() => {- setIsActive(exact ? pathname === href : pathname.startsWith(href));- }, [exact, pathname, href]);+ const isActive = useMemo(() => {+ return pathname === href || (exact && pathname.startsWith(href));+ }, [pathname, href, exact]);return (<Link