Skip to content

Commit 6997be9

Browse files
committed
refactor: use useIsomorphicLayoutEffect
1 parent 3018527 commit 6997be9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/core/src/components/EditableTypography/EditableTypography.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { ElementType, forwardRef, useEffect, useRef, useState, useLayoutEffect } from "react";
1+
import React, { ElementType, forwardRef, useEffect, useRef, useState } from "react";
22
import cx from "classnames";
33
import useMergeRef from "../../hooks/useMergeRef";
44
import VibeComponentProps from "../../types/VibeComponentProps";
@@ -10,6 +10,7 @@ import { TooltipProps } from "../Tooltip/Tooltip";
1010
import usePrevious from "../../hooks/usePrevious";
1111
import { TextType, TextWeight } from "../Text/Text.types";
1212
import { HeadingType, HeadingWeight } from "../Heading/Heading.types";
13+
import useIsomorphicLayoutEffect from "../../hooks/ssr/useIsomorphicLayoutEffect";
1314

1415
export interface EditableTypographyImplementationProps {
1516
/** Value of the text */
@@ -212,7 +213,7 @@ const EditableTypography: VibeComponent<EditableTypographyProps, HTMLElement> =
212213
}
213214
}, [autoSelectTextOnEditMode, isEditing]);
214215

215-
useLayoutEffect(() => {
216+
useIsomorphicLayoutEffect(() => {
216217
if (!typographyRef.current) {
217218
return;
218219
}

0 commit comments

Comments
 (0)