const [value, setvalue] = useState('');
<input type='text' autoFocus value={value} placeholder='Type here...' onChange={(e) => {
setvalue(e.target.value);
}} onKeyPress={(e) => {
if (e.nativeEvent.key === 'Enter') {
console.log('You haved typed enter');
}
}} />