diff --git a/components/form/FormItem.tsx b/components/form/FormItem.tsx index ccde326444fb..c2bf155fe473 100644 --- a/components/form/FormItem.tsx +++ b/components/form/FormItem.tsx @@ -55,8 +55,6 @@ export default class FormItem extends React.Component { context: FormItemContext; - state = { helpShow: false }; - helpShow = false; componentDidMount() { @@ -128,7 +126,7 @@ export default class FormItem extends React.Component { onHelpAnimEnd = (_key: string, helpShow: boolean) => { this.helpShow = helpShow; if (!helpShow) { - this.setState({ helpShow }); + this.setState({}); } } @@ -314,7 +312,7 @@ export default class FormItem extends React.Component { const style = props.style; const itemClassName = { [`${prefixCls}-item`]: true, - [`${prefixCls}-item-with-help`]: this.helpShow || this.state.helpShow, + [`${prefixCls}-item-with-help`]: this.helpShow, [`${prefixCls}-item-no-colon`]: !props.colon, [`${props.className}`]: !!props.className, };