import { useState } from 'react';
const CityNameInput = () => {
const [cityName, setCityName] = useState('Seattle');
const renameCity = (changeEvent) => {
console.log('Details about the element that fired the event:', changeEvent.target);
console.log('The value of that element:', changeEvent.target.value);
setCityName(changeEvent.target.value);
};
return (
<section>
<h2>{cityName}</h2>
<input type="text" value={cityName} onChange={renameCity} />
</section>
);
};