Menu Item when using React Router Link: PropType error and aggressive styling
See original GitHub issueOne issue and one annoyance.
1 - Warning: Failed prop type: Invalid prop 'is' supplied to 'MenuItem'
2 - Doing this with a Menu.Item renders the menu with an underline and coloured like an anchor. Really it should still be styled as a menu-item and not a link. I can override it manually but thats a pain.
Code:
<Menu.Item
is={Link}
to="/settings/"
icon="settings"
>
Settings
</Menu.Item>
</Menu>
Image:
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
Using Button > "is" with React Router Link gives PropTypes ...
Hi - when I use the button component, setting the 'is' prop to be react router link, I get a prop type warning:....
Read more >How to style React Router links with styled-components
Let's look at how to use styled-components and TypeScript to style React Router links in an application's navbar.
Read more >React Router link isn't working in Menu.Item element in ...
I'm trying to route in a react app using react-router-dom but it seems there is a problem when I try to put a...
Read more >React — Router + TypeChecking with PropTypes + HOC
In this we will learn the complete routing for react and will cover below things: Route; Link; NavLink; Redirect; Prompt.
Read more >material-ui/core/CHANGELOG.md - UNPKG
3640, - [Link] Improve TypeScript integration with react-router (#15412) @pachuka. 3641, - [ButtonBase] Remove dead style (#15503) @koshea. 3642, - [Menu] ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sorry to spam this one issue thread with other comments, but I found why the page is jumping around.
I am pretty sure it is to do with the popover giving the menu button focus on close. Are you be open to having a flag on the
popup
to bypass this behaviour? If so, I might try doing a PR.Pretty sure this is what is causing the jump: https://github.com/segmentio/evergreen/blob/master/src/popover/src/Popover.js#L193
Having this function be conditional
this.bringFocusBackToTarget()
on a new flag passed to Popover might solve it. https://github.com/segmentio/evergreen/blob/master/src/popover/src/Popover.js#L254@cstrat You shouldn’t have to mess with
ts
all the src code is injs
! It’s a little tricky to figure out how the theming/styling works under the hood though.