Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to only register one click on nested component and not parent component in react js

childOnClick = event => {
    event.stopPropagation(); // will prevent parentOnClick from triggering
    //.... your code for what happens on child on click
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #register #click #nested #component #parent #component #react #js
ADD COMMENT
Topic
Name
3+3 =