![]() Or if other people know of a good existing way (or a better non-existing way) to take care of that use-case, I'd love to hear it. For the situation described above, I'd probably have to end up writing another component wrapping this logic and rendering either a or an accordingly - don't other react-router users want the same thing? ![]() Seems it would be nicer for react-router users if the provided did this for them. If doesn't understand how to deal with both, then I need to perform the logic myself that distinguishes between external URLs and routes and renders different elements accordingly. I want to map those to components and render them. Let's say I have an array of objects representing 20 links, a few of which are "routes" and a few of which are true URLs. (Also, it's confusing that the external links work without a protocol?) If that's the case, then (with docs clarified) this issue still stands but as a feature request rather than a bug. To open an url in a new tab, you can use the Link tag as below: Open YourRoute in a new tab Its nice to keep in mind that the element gets translated to an element, and as per react-router-dom docs, you can pass any props youd like to be on it such as title, id, className, etc.
0 Comments
Leave a Reply. |