Skip to content

Commit

Permalink
fix proptypes
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasznguyen committed Apr 10, 2021
1 parent 3b2c8e9 commit bcb8643
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/material-ui/src/Menu/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import MenuList from '../MenuList';
import Paper from '../Paper';
import Popover from '../Popover';
import experimentalStyled, { shouldForwardProp } from '../styles/experimentalStyled';
import useTheme from '../styles/useTheme';
import useThemeProps from '../styles/useThemeProps';
import setRef from '../utils/setRef';
import menuClasses, { getMenuUtilityClass } from './menuClasses';
Expand Down Expand Up @@ -83,7 +84,7 @@ const MenuMenuList = experimentalStyled(
});

const Menu = React.forwardRef(function Menu(inProps, ref) {
const { isRtl, theme, ...props } = useThemeProps({ props: inProps, name: 'MuiMenu' });
const props = useThemeProps({ props: inProps, name: 'MuiMenu' });

const {
autoFocus = true,
Expand All @@ -101,6 +102,10 @@ const Menu = React.forwardRef(function Menu(inProps, ref) {
...other
} = props;

// use the `isRtl` from the props after the buildAPI script support it
const theme = useTheme();
const isRtl = theme.direction === 'rtl';

const styleProps = {
...props,
autoFocus,
Expand Down Expand Up @@ -278,6 +283,10 @@ Menu.propTypes /* remove-proptypes */ = {
* If `true`, the component is shown.
*/
open: PropTypes.bool.isRequired,
/**
* @ignore
*/
PaperProps: PropTypes.object,
/**
* `classes` prop applied to the [`Popover`](/api/popover/) element.
*/
Expand Down

0 comments on commit bcb8643

Please sign in to comment.