fix: select 不在 form 下面报 addHook 不是函数的错误 (#10214)

This commit is contained in:
liaoxuezhi 2024-05-11 11:54:12 +08:00 committed by GitHub
parent 118aaf5da8
commit 9b11bdcdc4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -341,7 +341,10 @@ export default class SelectControl extends React.Component<SelectProps, any> {
if (!formInited) {
this.unHook && this.unHook();
return (this.unHook = addHook(this.loadRemote.bind(this, input), 'init'));
return (
addHook &&
(this.unHook = addHook(this.loadRemote.bind(this, input), 'init'))
);
}
this.lastTerm = input;