DEV Community

Discussion on: Trigger an onClick event outside the child element, works for nested child components too.

mohammad_seyfayi profile image
Mohammad Seyfayi

In this solution the chid element have to know the className of its parent
And I think it's a bad practice

hamsahn profile image
Hamsa H N Author

This is one of the approaches that I could think of. Please let us know if there is a way to avoid child element not having to know the parent's className. Would love to learn.