const dispatch = useDispatch()
const city = useSelector((state: TRootState) => state.city)
const [inputCityValue, setInputCityValue] = useState(city)
return (
<form onSubmit={
(event) => {
event.preventDefault()
dispatch(setCity(inputCityValue))
}
}>
<p>{city}</p>
<Input name={'test'} value={inputCityValue} onChange={onChangeHandlerWrapper(setInputCityValue)}/>
<button type='submit'><span>Обновить данные</span></button>
</form>
)
<form onSubmit={
(event) => {
event.preventDefault()
dispatch(setCity(event.target['test'].value))
}
}>
event.target['test'].value
Element implicitly has an 'any' type because expression of type '"test"' can't be used to index type 'EventTarget'.
Property 'test' does not exist on type 'EventTarget'.
<form onSubmit={
(event) => {
event.preventDefault()
console.log(event.target.value)
}
}>
<Input value={inputCityValue} onChange={onChangeHandlerWrapper(setInputCityValue)}/>
<button type='submit'><span>Обновить данные</span></button>
</form>
return () => el.classList.remove(theme);