call two functions within onchange event in react
You can only assign a handler to onChange
once. When you use multiple assignments like that, the second one will overwrite the first one.
You will either have to make a handler that calls both functions, or use an anonymous function:
twoCalls = e => {
this.functionOne(e)
this.functionTwo()
}
.
.
.
<FormControl
name="searching"
placeholder="Searching"
onChange={this.twoCalls}
/>
Or...
<FormControl
name="searching"
placeholder="Searching"
onChange={e => { this.functionOne(e); this.functionTwo() }}
/>
if you need props you can use it
<FormControl
name="searching"
placeholder="Searching"
onChange={e => { this.functionOne(e); this.props.functionTwo(e)}
/>