Answers for "Warning: Failed prop type: You provided a `value` prop to a form field without an `onChange` handler."

0

Warning: Failed prop type: You provided a `value` prop to a form field without an `onChange` handler.

state = {
   keyword: 'test' 
} 

inputChangedHandler = (event) => {
    const updatedKeyword = event.target.value;
    // May be call for search result
}

render() {
  return (
      <input 
         type="text" 
         placeholder="Search..."
         value={this.state.keyword} 
         onChange={(event)=>this.inputChangedHandler(event)} />
   );
}
Posted by: Guest on March-01-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language