I have a nested div in react like this:
<div onClick={() => fn_01()}>
<div onClick={() => fn_02()}>
</div>
</div>
I want to call different function when user click those div. But when I click the 1st div it called fn_01()
and when I click the 2nd div it also call fn_01()
. How can I solve this issue.
I am using functional component in my react project. I also implement Class component and call those method using this.
, which doesn't work also. I need this work in Functional Component