Element implicitly has an 'any' type because expression of type '0' can't be used to index type 'EventTarget'.
Property '0' does not exist on type 'EventTarget'
<form onSubmit={
(event) => {
event.preventDefault()
console.log(event.target[0].value)
}
}>
console.log(event.target['test'].value)
(данный пример от Вадим)<form onSubmit={
(event) => {
event.preventDefault()
console.log(inputCityValue)
}
}>
<Input value={inputCityValue} onChange={onChangeHandlerWrapper(setInputCityValue)}/>
<button type='submit'><span>Обновить данные</span></button>
</form>
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>
)