Skip to content

Commit e0e2eb6

Browse files
authored
fix(editor): fix flash of height (#140)
Co-authored-by: stream-pipe <stream-pipe@users.noreply.github.com>
1 parent fe65d17 commit e0e2eb6

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@coze-editor/react",
5+
"comment": "fix flash of height",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@coze-editor/react",
10+
"email": "stream-pipe@users.noreply.github.com"
11+
}

packages/text-editor/react/src/renderer.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import React, {
99
useState,
1010
type ReactNode,
1111
useMemo,
12+
useLayoutEffect,
1213
} from 'react';
1314

1415
import { FacetCombineStrategy } from '@coze-editor/utils';
@@ -85,7 +86,7 @@ function Renderer<T extends EditorPluginSpec<string, any, any>[]>(
8586

8687
propsRef.current = props;
8788

88-
useEffect(() => {
89+
useLayoutEffect(() => {
8990
const { render, eventKeys } = create({
9091
plugins,
9192
injector,

0 commit comments

Comments
 (0)