-
-
Notifications
You must be signed in to change notification settings - Fork 46.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drawer组件3.20.4之后版本children的Ref首次不能正常获取 #17886
Comments
this.setState({
visible: true,
}, () => {
setTimeout(() => {
console.log(this.formRef)
})
}); |
以前项目改动量大,暂时降低版本解决了,但是在setState回调里面还Timeout觉得有点奇怪 |
按 #21543 (comment) 的描述,Drawer 的 |
so drawer does not take forceRender. any other way? |
It had been fixed in antd 4.x, check https://codepen.io/afc163/pen/PomKdmJ?editors=0010 |
Reproduction link
https://codepen.io/tivonjj/pen/NQrMrX?editors=0011
Steps to reproduce
this.setState({
visible: true,
},()=>{
console.log(this.formRef)
});
第一次显示,在setState回调内ref是undefined,children并未初始化,但是3.20.3及之前版本一直正常,升级到3.20.4及之后版本都存在此问题
What is expected?
第一次显示可以获取children的Ref
What is actually happening?
第一次显示无法获取children的Ref
The text was updated successfully, but these errors were encountered: