score:4

Accepted answer
onSearchChange(event) {
   this.setState({ searchTerm: event.target.value })
}

score:1

class TextFieldItem extends React.Component{
        constructor(props){
            super(props);
            this.onChange=this.onChange.bind(this);
        }
        onChange(e){
            event.preventDefault();
            const {onFieldChange,field} = this.props;   
            onFieldChange(e.target.id, e.target.value, e.target.name,field.Type);
        }
        render(){        
            const {field, onFieldChange, onRecordUpdate, IsLookupField,record,currentDocumentType} = this.props;       
            const fieldValue = (field.Value == null) ? '' : field.Value;
            return (
                <div>
                    <label>{field.Name}</label> 
                    <input type="text" key={field.Id} className="form-control" id={field.Id} name={field.Name} onChange={this.onChange} value={fieldValue} />     
                    {IsLookupField && <LookupFieldItem record={record} field={field} onRecordUpdate={onRecordUpdate} documentType={currentDocumentType} /> }
                </div>
                );
        }
    }
         export default TextFieldItem;

Related Query

More Query from same tag