Skip to content

Commit 6323ba3

Browse files
author
WB01676250
committed
fix: formItemInput
1 parent c0467cc commit 6323ba3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

components/form/FormItemInput.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as React from 'react';
22
import type { JSX } from 'react';
33
import classNames from 'classnames';
44
import { get, set } from 'rc-util';
5+
import useLayoutEffect from 'rc-util/lib/hooks/useLayoutEffect';
56

67
import type { ColProps } from '../grid/col';
78
import Col from '../grid/col';
@@ -96,7 +97,7 @@ const FormItemInput: React.FC<FormItemInputProps & FormItemInputMiscProps> = (pr
9697
const extraRef = React.useRef<HTMLDivElement>(null);
9798
const [extraHeight, setExtraHeight] = React.useState<number>(0);
9899

99-
React.useEffect(() => {
100+
useLayoutEffect(() => {
100101
if (!extra) {
101102
setExtraHeight(0);
102103
return;

0 commit comments

Comments
 (0)