How can I stop a nested button triggering the parent container Link using stopPropagation? I've checked the other question/answers but I still can't stop it happening. I have the following setup:
{feedData && feedData.map(post => (
<Link to={`/buy/${post.name}`} key={post.id}>
<Card />
</Link>
))}
The Card pulls in an Upvote component with a button inside it:
const Card = ({id}) => {
return (
<div>
...
<Upvote id={id}/>
</div>
)
}
The Upvote component is basically a button:
<button onClick={(e) => e.stopPropagation() | unlike()}>
<span>{likes}</span>
</button>
Can anyone see what I'm doing wrong, please?