Skip to content Skip to sidebar Skip to footer

Pass Values To Child Component On Click Submit Button - Reactjs, Click Twice

I want to pass values from SearchInput (parent) to FetchData (child) component. It does not work properly, because I have to click twice to fetch data and this.props.loaded should

Solution 1:

You have to enclose the submit attribute in an arrow function:

onClick{()=>this.handleSubmutButton()}

Do the same for on change as well


Post a Comment for "Pass Values To Child Component On Click Submit Button - Reactjs, Click Twice"