question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Menu Item when using React Router Link: PropType error and aggressive styling

See original GitHub issue

One 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:

image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
cstratcommented, Feb 5, 2020

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

1reaction
Chrischuckcommented, Feb 4, 2020

@cstrat You shouldn’t have to mess with ts all the src code is in js! It’s a little tricky to figure out how the theming/styling works under the hood though.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found