Hover only on child not on parent
Unanswered
Chukar posted this in #help-forum
ChukarOP
I have recursively called many levels of nested children and all divs have hovering effect class but I want to show border only on that child which is at the bottom level when hover on that child.
I wrote the code like below
export function handleHover(e) {
e.stopPropagation();
}
<div
className="hoverBorder"
onMouseEnter={handleHover}
onMouseLeave={handleHover}
></div>
as this it a child but parent also have the same styles.
No I want to show border only on child when hovering on child not the parent. So I wrote e.stopPropagation() but this is not working.
I wrote the code like below
export function handleHover(e) {
e.stopPropagation();
}
<div
className="hoverBorder"
onMouseEnter={handleHover}
onMouseLeave={handleHover}
></div>
as this it a child but parent also have the same styles.
No I want to show border only on child when hovering on child not the parent. So I wrote e.stopPropagation() but this is not working.