From 5e0797b26953861e61c9237e6efd104a49208f40 Mon Sep 17 00:00:00 2001 From: fzaninotto Date: Thu, 13 Feb 2020 14:38:51 +0100 Subject: [PATCH] Fix custom menu snippet in theming documentation Closes #4416 --- docs/Theming.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/Theming.md b/docs/Theming.md index c0bfc34ee01..5bf53a4dea5 100644 --- a/docs/Theming.md +++ b/docs/Theming.md @@ -719,7 +719,7 @@ import React, { createElement } from 'react'; import { useSelector } from 'react-redux'; import { useMediaQuery } from '@material-ui/core'; import { MenuItemLink, getResources } from 'react-admin'; -import { withRouter } from 'react-router-dom'; +import DefaultIcon from '@material-ui/icons/ViewList'; import LabelIcon from '@material-ui/icons/Label'; const Menu = ({ onMenuClick, logout }) => { @@ -732,8 +732,13 @@ const Menu = ({ onMenuClick, logout }) => { : + } onClick={onMenuClick} sidebarIsOpen={open} /> @@ -750,7 +755,7 @@ const Menu = ({ onMenuClick, logout }) => { ); }; -export default withRouter(Menu); +export default Menu; ``` **Tip**: Note the `MenuItemLink` component. It must be used to avoid unwanted side effects in mobile views.