Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

react typescript onclick stop propagation

handleClick(event:  React.MouseEvent<HTMLButtonElement>) {
    event.stopPropagation();
  	...
  	the_click();
}

render() {
	...
    <button onClick={this.handleClick}>Click me</button>
    ...
}
Source by www.codegrepper.com #
 
PREVIOUS NEXT
Tagged: #react #typescript #onclick #stop #propagation
ADD COMMENT
Topic
Name
2+3 =