-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
validateDOMNesting(...): <a> cannot appear as a descendant of <a>. #979
Comments
Hi @CruiseMan ! You should use Demo: |
What @gergely-nagy said is correct, but I think this may also be a slight defect. reactstrap is defaulting Lines 40 to 50 in 6eac0fd
I think we can do some better defaulting there. For instance, not only can we only make it an anchor tag ( |
How do i make after click redirect to <Media href={url}>
<Media className="mt-1 align media-block">
<Media left bottom>
<img src={item.image} alt="logo" className="media-logo" />
</Media>
<Media body>
<Media heading>
{item.name}
</Media>
{item.description}
</Media>
</Media>
</Media> |
|
🤔warning still there |
https://stackblitz.com/edit/reactstrap-v5-media-click-p3ufgg?file=Example.js import React, { Component } from 'react';
import { Media } from 'reactstrap';
class Example extends Component {
render() {
return (
<Media tag="a" href="something">
<Media className="mt-1 align media-block">
<Media left bottom tag="div" className="mr-2">
<img src="https://github.com/TheSharpieOne.png?size=60" alt="logo" className="media-logo" />
</Media>
<Media body>
<Media heading>
TheSharpiOne
</Media>
Front-end Developer
</Media>
</Media>
</Media>
)
}
}
export default Example; |
Works only if i remove |
Notice the |
Media will now more smartly determine the tag is no tag is provided. It will use other attirbutes to determine which tag makes sense. having an href only makes sense on an anchor, so it will use an anchor tag when an href is present Ref #979
I'm trying to make whole Media clickable, but got the warning: index.js:2178 Warning: validateDOMNesting(...): cannot appear as a descendant of .
The text was updated successfully, but these errors were encountered: