Clear input field by setting state instead of manipulating the DOM
Use state map instead of destructured text element for consistency