handling select options in React Hooks
问题 I am trying to get the text value from a dropdown select using [useState} in React Hooks. I just get the value (number) rather than the text. Ive copied the bits of code below which control the select dropdown. What am i missing here? Thanks. const [addrtype, setAddrType] = useState('Home') function handleAddrTypeChange(e) { setAddrType(e.target.value); console.log(addrtype) } <select defaultValue={addrtype} onChange={handleAddrTypeChange} className="browser-default custom-select"> <option