diff --git a/docs/data/base/components/menu/UseMenu.js b/docs/data/base/components/menu/UseMenu.js index d495d627a0b845..df277a54b158fc 100644 --- a/docs/data/base/components/menu/UseMenu.js +++ b/docs/data/base/components/menu/UseMenu.js @@ -150,13 +150,16 @@ const Menu = React.forwardRef(function Menu(props, ref) { open, }); - const contextValue = { - registerItem, - unregisterItem, - getItemState, - getItemProps, - open: true, - }; + const contextValue = React.useMemo( + () => ({ + registerItem, + unregisterItem, + getItemState, + getItemProps, + open: true, + }), + [getItemProps, getItemState, registerItem, unregisterItem], + ); return (