fix: fix FormItem hooks render error (#22053)

This commit is contained in:
Jingsong Gao 2020-03-10 13:19:35 +08:00 committed by GitHub
parent 122b2185db
commit f21b4684c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -227,14 +227,14 @@ function FormItem(props: FormItemProps): React.ReactElement {
const isRenderProps = typeof children === 'function';
if (!hasName && !isRenderProps && !dependencies) {
return renderLayout(children);
}
// Record for real component render
const updateRef = React.useRef(0);
updateRef.current += 1;
if (!hasName && !isRenderProps && !dependencies) {
return renderLayout(children);
}
return (
<Field
{...props}