I want to get the value of input after submitting the form but code gives me the error - 'Form submission canceled because the form is not connected'. I know that if I change the button type from submit to button it will work, but I need submit method because on button click the other action is written and dont want to write code inside onclick function
updateItem(e) {
// console.log(this.input.value);
console.log(2222222222);
e.preventDefault();
}
render() {
return (
<div className='wrapper'>
<form onSubmit={this.updateItem}>
<input className='input'
type="text"
defaultValue={this.props.defValue}
// ref={(value) => {
// this.input = value
// }}
/>
<button type="submit"
className='submitButton'
onClick{this.props.editItem}>Update
</button>
</form>
</div>
);
}