<input type='text' value='state' onChange={(e) => DB.update(e.target.vaule).then(newData => setState(e.target.vaule)}/>
I think you should try this