Skip to content

Commit aa0d3cd

Browse files
committed
chore(website): useIsomorphicLayoutEffect to hide SSR warning
1 parent 638c8ec commit aa0d3cd

File tree

1 file changed

+3
-2
lines changed
  • packages/documentation/src/components/Layout

1 file changed

+3
-2
lines changed

packages/documentation/src/components/Layout/Layout.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { ReactElement, ReactNode } from "react";
2-
import { useEffect, useRef, useState, useLayoutEffect } from "react";
2+
import { useEffect, useRef, useState } from "react";
33
import type { ConfiguredIcons } from "@react-md/icon";
44
import type { LayoutConfiguration } from "@react-md/layout";
55
import {
@@ -25,6 +25,7 @@ import {
2525
import type { MenuConfiguration } from "@react-md/menu";
2626
import { useCrossFadeTransition } from "@react-md/transition";
2727
import type { AppSizeListenerProps } from "@react-md/utils";
28+
import { useIsomorphicLayoutEffect } from "@react-md/utils";
2829

2930
import type { CodePreference } from "components/CodePreference";
3031
import { CodePreferenceProvider } from "components/CodePreference";
@@ -95,7 +96,7 @@ export default function Layout({
9596

9697
const prevPathname = useRef(pathname);
9798
const { elementProps, transitionTo } = useCrossFadeTransition();
98-
useLayoutEffect(() => {
99+
useIsomorphicLayoutEffect(() => {
99100
if (prevPathname.current === pathname) {
100101
return;
101102
}

0 commit comments

Comments
 (0)