The problem:
We have a hook that implements some DOM event logic and hook is used in some components. The hook is a red star.
That hook is used in parent and child components so its like "A* -> B*", where * is a hook.
When DOM event is triggered hook calls callbacks that is passed from components.
But it calls the both parent and child hooks. But we need to call only one callback not calling parent.
So I wonder, does React give us a call tree so we can know who parent is?
P.S. using a DOM tree probably can solve my problem but if we use portals its useless.
P.S.S. calling order is always random so we cannot use stopPropagation. We need to know is there any child that uses the same hook so we dont call parent's callback.