Skip to content

Commit

Permalink
fix: render order warning
Browse files Browse the repository at this point in the history
  • Loading branch information
hemengke1997 committed Jul 22, 2021
1 parent 0f5cb97 commit 3f49017
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ResizableHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const AntdResizableHeader: React.FC<ComponentProp> = (props) => {

const [resizeWidth, setResizeWidth] = React.useState<number>(0);

React.useEffect(() => {
React.useLayoutEffect(() => {
if (width && !isLast) {
const domWidth = thRef.current?.getBoundingClientRect().width || width;
const w = domWidth > width ? domWidth : width;
Expand All @@ -41,7 +41,7 @@ const AntdResizableHeader: React.FC<ComponentProp> = (props) => {
}
}, [triggerMount]);

React.useEffect(() => {
React.useLayoutEffect(() => {
if (width) {
setResizeWidth(width);
}
Expand Down

0 comments on commit 3f49017

Please sign in to comment.