material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

[Menu] ownerState is undefined when the Menu is opened

Open takakobem opened this issue 3 years ago • 0 comments

Duplicates

  • [X] I have searched the existing issues

Latest version

  • [X] I have tested the latest version

Steps to reproduce 🕹

You can check here. When you click DASHBOARD button and error occurs. https://codesandbox.io/s/amazing-dubinsky-pkesu9?file=/index.js

Current behavior 😯

TypeError occurs.

paper
/index.js:20:31
  17 | styleOverrides: {
  18 |   paper: ({ ownerState }) => ({
  19 |     marginTop:
> 20 |       ownerState.anchorOrigin?.vertical === "bottom" &&
     |                 ^
  21 |       ownerState.transformOrigin?.vertical === "top"
  22 |         ? "4px"
  23 |         : 0

Expected behavior 🤔

no error occurs and can access ownerState.

Context 🔦

I created custom theme for MuiMenu to change the style.

Your environment 🌎

CodeSandbox

takakobem avatar Sep 21 '22 03:09 takakobem