DEV Community

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

Collapse
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

Collapse
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.