ant-design [Menu] - Warning: Accessing element.ref was removed in React 19

lzfw57am  于 3个月前  发布在  React
关注(0)|答案(2)|浏览(87)

Steps to reproduce

Add a children prop to a Menu item. No warning is given if the children prop is removed. No "ref" prop is needed for a warning to appear (if children prop is provided).

What is expected?

No warning should appear.

What is actually happening?

Full warning is:

Warning: Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.
| Environment | Info |
| ------------ | ------------ |
| antd | 5.18.0 |
| React | 19.0.0-rc.0 |
| System | Windows |
| Browser | Chrome v126.0.6468.2 |

cgh8pdjw

cgh8pdjw1#

This is also happening with tabs.
| Environment | Info |
| ------------ | ------------ |
| antd | 5.18.0 |
| React | 19.0.0-beta-26f2496093-20240514 |
| System | macOs Sonoma |
| Browser | Chrome v125.0.6422.142 |

vsaztqbk

vsaztqbk2#

And also happening with the <Slider />

相关问题