Cancel onClick event of parent component in child component in React

Viewed 5956

I have a component that looks like:

<ParentComponent onClick={this.doSomething}>
  <ChildComponent onClick={this.doSomethingElse} />
</Parent>

If I click on the ChildComponent, both doSomethingElse and doSomething fire. How can I cancel the parent component onClick event propagation when the child onClick event fires?

2 Answers
Related