From bcb8643ae54fac6a85cc0491317ba17066ecb416 Mon Sep 17 00:00:00 2001 From: Tomasz Nguyen Date: Sat, 10 Apr 2021 13:42:02 +0200 Subject: [PATCH] fix proptypes --- packages/material-ui/src/Menu/Menu.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/material-ui/src/Menu/Menu.js b/packages/material-ui/src/Menu/Menu.js index e5533067d52eb4..31c54f6eadc1e9 100644 --- a/packages/material-ui/src/Menu/Menu.js +++ b/packages/material-ui/src/Menu/Menu.js @@ -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'; @@ -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, @@ -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, @@ -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. */