React prevent event bubbling in nested components on click

前端 未结 8 1530
隐瞒了意图╮
隐瞒了意图╮ 2020-11-27 02:41

Here\'s a basic component. Both the

    and
  • have onClick functions. I want only the onClick on the
  • to fir
8条回答
  •  情话喂你
    2020-11-27 03:05

    This is an easy way to prevent the click event from moving forward to the next component and then call your yourFunction.

    
    

提交回复
热议问题