Skip to content

[Menu] - Warning: Accessing element.ref was removed in React 19 #49267

Closed

Description

@alaychak-hc

Reproduction link

Edit on CodeSandbox

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

Activity

  1. vylink commented on Jun 7, 2024

    @vylink

    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
  2. brandonfake69 commented on Jul 30, 2024

    @brandonfake69

    And also happening with the <Slider />

  3. tiarebalbi commented on Sep 2, 2024

    @tiarebalbi

    ➕

    app-index.tsx:30 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.
        at Wave (webpack-internal:///(app-pages-browser)/./node_modules/antd/es/_util/wave/index.js:26:13)
        at eval (webpack-internal:///(app-pages-browser)/./node_modules/antd/es/button/button.js:65:13)
        at FloatingRecordContainer (webpack-internal:///(app-pages-browser)/./src/components/FloatingRecordContainer.tsx:14:13)
        at NovoCliente (webpack-internal:///(app-pages-browser)/./src/app/(dashboard)/d/clientes/components/NovoCliente.tsx:23:76)
        at div
        at div
        at div````
    
  4. nicevlhjfihtqngkldl commented on Sep 30, 2024

    @nicevlhjfihtqngkldl

    Same problem.Does the maintainer have the plan to fix this?

  5. rendeyuwei commented on Oct 11, 2024

    @rendeyuwei

    same problem

  6. xqinwl commented on Oct 16, 2024

    @xqinwl

    same problem too

  7. aurora-lch commented on Oct 22, 2024

    @aurora-lch

    react 18.3.1 antd 5.21.5
    same problem

  8. israel-lpz commented on Oct 22, 2024

    @israel-lpz

    same problem

  9. rftglyv commented on Oct 23, 2024

    @rftglyv

    Same Problem

    "next": "15.0.1",
    "react": "^18.3.1",
    "react-dom": "^18.3.1",

  10. jvnm-dev commented on Oct 24, 2024

    @jvnm-dev

    Same w/ next 15

  11. 51 remaining items

  12. alexfilitaryn-awtg commented on Dec 4, 2024

    @alexfilitaryn-awtg

    +1

  13. ianzone commented on Dec 6, 2024

    @ianzone

    Now React 19 has been released

  14. zombieJ commented on Dec 6, 2024

    @zombieJ
    Member

    See plan here: #51919

  15. Kekajan commented on Dec 6, 2024

    @Kekajan

    +1

  16. saifookhan commented on Dec 8, 2024

    @saifookhan

    +1

  17. lexmin0412 commented on Dec 8, 2024

    @lexmin0412

    Same Problem.

  18. verhovensky commented on Dec 11, 2024

    @verhovensky

    Same for me with

      "dependencies": {
        "antd": "^5.22.4",
        "next": "15.1.0",
        "react": "^19.0.0",
        "react-dom": "^19.0.0"
      }
    
  19. prohui commented on Dec 14, 2024

    @prohui

    Same Problem.

  20. Saqib7865-dev commented on Dec 24, 2024

    @Saqib7865-dev

    Same issue while using RangePicker from DatePicker.

  21. arvinxx commented on Dec 25, 2024

    @arvinxx
    Contributor

    5.22.6 should have fixed this.

  22. manzaloros commented on Dec 30, 2024

    @manzaloros

    5.22.6 should have fixed this.

    Just FYI. 5.22.6 does not fix this issue. I still get ref console warnings with the Layout component and React 19 with Ant Design.

  23. vylink commented on Dec 30, 2024

    @vylink

    @MahdiYazdan , just tried on 5.22.7.. Didn't work until removed node_modules and re-installed dependencies. Hope it helps.

  24. Amaranthusss commented on Dec 31, 2024

    @Amaranthusss

    @vylink same here but I had to delete / update my yarn.lock. Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions