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.

<Anchor> and React Router v5

See original GitHub issue

Supporting react-router is crucial.

Recalling #576, we have an old solution that doesn’t work anymore, and simpler solution which works but produces some warnings:

Warning: validateDOMNesting(...): <a> cannot appear as a descendant of <a>.

This warning is only appears in Grommet v2. As we can see, @benshell makes Anchor a span with tag attribute:

<Link to={props.to}>
    <Anchor tag="span" primary={props.primary}>{props.children}</Anchor>
</Link>

It worked flawlessly in v1, but for v2 the tag prop is gone.

So how I supposed to combine these two links: one from react router and another one from Grommet v2?

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
oorestisimecommented, Nov 22, 2018

Hey, i’d like to give this a go. i am not really familiar with the codebase but it is something i need so i’d love to contribute back to grommet.

1reaction
oorestisimecommented, Nov 25, 2018

@alansouzati if you still want i could add a tag property to the Anchor component (if this would be more user friendly etc)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Link - React Router: Declarative Routing for React.js
Get the underlying ref of the component using React.createRef . let anchorRef = React.createRef() <Link to="/" innerRef={anchorRef} /> ...
Read more >
5 Remarkable React Router Features (Anchor Links, Query ...
React Router is a game-changing package that allows us to turn our React SPA (single page application), into a virtual "multi-page" experience.
Read more >
Create A Hash Anchor Link Effect With React-Router
To do this, I used react-router's Link component. I had used the NavLink for my navigation bar to take advantage of its styling...
Read more >
Use anchors with react-router - Stack Overflow
Details: I am using react-router in my React app. I have a site-wide navbar that needs to link to a particular parts of...
Read more >
React Router v5: The Complete Guide - SitePoint
React Router is the de facto standard routing library for React. When you need to navigate through a React application with multiple views, ......
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