<Anchor> and React Router v5
See original GitHub issueSupporting 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:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top 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 >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 FreeTop 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
Top GitHub Comments
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.
@alansouzati if you still want i could add a tag property to the Anchor component (if this would be more user friendly etc)