diff --git a/app/[locale]/layout.tsx b/app/[locale]/layout.tsx index 87d0f28dd1801..f9fcc6263b2bf 100644 --- a/app/[locale]/layout.tsx +++ b/app/[locale]/layout.tsx @@ -4,6 +4,7 @@ import classNames from 'classnames'; import { getLocale } from 'next-intl/server'; import type { FC, PropsWithChildren } from 'react'; +import FrozenRouter from '@/components/withFrozenRouter'; import BaseLayout from '@/layouts/Base'; import { VERCEL_ENV } from '@/next.constants.mjs'; import { IBM_PLEX_MONO, OPEN_SANS } from '@/next.fonts'; @@ -25,7 +26,9 @@ const RootLayout: FC = async ({ children }) => { - {children} + + {children} + diff --git a/components/Icons/HexagonGrid.tsx b/components/Icons/HexagonGrid.tsx index f9b688df7a371..09f5967f8fb88 100644 --- a/components/Icons/HexagonGrid.tsx +++ b/components/Icons/HexagonGrid.tsx @@ -114,7 +114,7 @@ const HexagonGrid: FC = props => ( @@ -326,7 +326,7 @@ const HexagonGrid: FC = props => ( @@ -348,7 +348,7 @@ const HexagonGrid: FC = props => ( @@ -560,7 +560,7 @@ const HexagonGrid: FC = props => ( @@ -597,7 +597,7 @@ const HexagonGrid: FC = props => ( @@ -811,7 +811,7 @@ const HexagonGrid: FC = props => ( @@ -1023,7 +1023,7 @@ const HexagonGrid: FC = props => ( @@ -1045,7 +1045,7 @@ const HexagonGrid: FC = props => ( @@ -1257,7 +1257,7 @@ const HexagonGrid: FC = props => ( @@ -1294,7 +1294,7 @@ const HexagonGrid: FC = props => ( diff --git a/components/withFrozenRouter.tsx b/components/withFrozenRouter.tsx new file mode 100644 index 0000000000000..2d03faa488d0b --- /dev/null +++ b/components/withFrozenRouter.tsx @@ -0,0 +1,18 @@ +'use client'; + +import { LayoutRouterContext } from 'next/dist/shared/lib/app-router-context.shared-runtime'; +import type { FC, PropsWithChildren } from 'react'; +import { useContext, useRef } from 'react'; + +const FrozenRouter: FC = props => { + const context = useContext(LayoutRouterContext); + const frozen = useRef(context).current; + + return ( + + {props.children} + + ); +}; + +export default FrozenRouter;