ant-design / ant-design

An enterprise-class UI design language and React UI library
https://ant.design
MIT License
92.47k stars 49.75k forks source link

Can not get the child node ref in the useEffect when the tab is visible at the first time #38205

Open JackClown opened 2 years ago

JackClown commented 2 years ago

Reproduction link

Edit on CodeSandbox

Steps to reproduce

click Tab 2

What is expected?

console shows tab 2 ref <div>Content of Tab Pane 2</div>

What is actually happening?

tab 2 ref null

Environment Info
antd 4.23.6
React 17.0.2
System macOS Monterey
Browser Chrome 106

it works fine at antd@4.21.6. maybe it is caused by the rc-tabs using rc-motion which delays child node mounting after active changed

github-actions[bot] commented 2 years ago

You may look for issues:

  1. 51% #26545
  2. 50% #26096

🤖 By issues-similarity-analysis

JackClown commented 2 years ago

Any update on this matter?

JackClown commented 2 years ago

@afc163

JackClown commented 1 year ago

Modal has similar problem that it will delay children nodes rendering with antd@4.24.x

JackClown commented 1 year ago

the rendering order is different as we think in the normal

JackClown commented 1 year ago

@zombieJ

monolithed commented 1 year ago

I have a similar issue with flickering and render lag