我只是有一个小问题。
我想通过输入输入来更新“postleitzahl”。
我正在使用 useState Hook。
我如何只定位 formData 中的“postleitzahl”而不是整个 formData
这是我的代码
const defualtData = {
Immobilie: null,
Fläche: null,
Gebäudeart: null,
Wohnfläche: null,
postleitzahl: null,
}
const [formData, setForm] = useState(defualtData)
< input
type = "number"
name = "postleitzahl"
onChange = {(e) => { setForm(e.target.value) }}
/>