Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menu component logs findDOMNode warning in Strict Mode #27287

Closed
2 tasks done
hamza1311 opened this issue Jul 14, 2021 · 2 comments
Closed
2 tasks done

Menu component logs findDOMNode warning in Strict Mode #27287

hamza1311 opened this issue Jul 14, 2021 · 2 comments
Labels
component: menu This is the name of the generic UI component, not the React module! duplicate This issue or pull request already exists

Comments

@hamza1311
Copy link

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 馃槸

Uses findDOMNode(?) which causes the warning to be logged

Expected Behavior 馃

No warning to be logged

Steps to Reproduce 馃暪

  1. Run this example in strict mode
  2. Open the menu
  3. Notice the warning logged to the console
The logged warning
Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of Transition which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node
div
Paper@https://o5epz.csb.app/node_modules/@material-ui/core/esm/Paper/Paper.js:42:17
WithStyles@https://o5epz.csb.app/node_modules/@material-ui/styles/esm/withStyles/withStyles.js:47:25
Transition@https://o5epz.csb.app/node_modules/react-transition-group/esm/Transition.js:35:30
Grow@https://o5epz.csb.app/node_modules/@material-ui/core/esm/Grow/Grow.js:35:18
Unstable_TrapFocus@https://o5epz.csb.app/node_modules/@material-ui/core/esm/Unstable_TrapFocus/Unstable_TrapFocus.js:17:18
div
Portal@https://o5epz.csb.app/node_modules/@material-ui/core/esm/Portal/Portal.js:24:18
Modal@https://o5epz.csb.app/node_modules/@material-ui/core/esm/Modal/Modal.js:63:41
Popover@https://o5epz.csb.app/node_modules/@material-

Context 馃敠

See the codesandbox: https://codesandbox.io/s/material-demo-forked-3zn5o
Potentially related issue: #13394

Your Environment 馃寧

`npx @material-ui/envinfo`
  System:
    OS: Linux 5.12 Arch Linux
  Binaries:
    Node: 16.4.2 - /usr/bin/node
    Yarn: Not Found
    npm: 7.17.0 - /usr/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: 89.0.2 (browser used for testing)

Also see the codesandbox above

@hamza1311 hamza1311 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jul 14, 2021
@oliviertassinari
Copy link
Member

Duplicate of #13394

@oliviertassinari oliviertassinari marked this as a duplicate of #13394 Jul 14, 2021
@github-actions github-actions bot added duplicate This issue or pull request already exists and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jul 14, 2021
@oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari added the component: menu This is the name of the generic UI component, not the React module! label Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: menu This is the name of the generic UI component, not the React module! duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants