Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react why onclick property function trigger without click

change:
  <button type="button" onClick={this.myFunction(argument)}> myButton </button>
  
to this: 
  <button type="button" onClick={this.myFunction.bind(this, argument)}> myButton </button>
Source by www.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #react #onclick #property #function #trigger #click
ADD COMMENT
Topic
Name
8+5 =