const App = () => {
const [message, setMessage] = useState('');
return (
<div>
<input
type="text"
value={message}
onChange={(event) => {
setMessage(event.target.value);
}}/>
<button
onClick={() => {
alert('check')
// clear input value
setMessage('');
}}>
Clear field
</button>
</div>
);
};