You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can I fetch each value and put it into the rest of the inputs I have. They are all using things such as const [address, setAddress] = useState(shippingAddress.address); const [city, setCity] = useState(shippingAddress.city); const [state, setState] = useState(shippingAddress.state) const [postalCode, setPostalCode] = useState(shippingAddress.postalCode); const [country, setCountry] = useState(shippingAddress.country);
#371
Open
talmax1124 opened this issue
Jul 1, 2021
· 3 comments
consthandleSelect=(value)=>{console.log('handleSelect: ',value)constcomps=value.split(',');// return has form `address, City, State, Country`console.log('comps: ',comps);setAddress(comps[0]);setCity(comps[1]);setCountry(comps[2]);});
But it's not returning a zip code/postal code, so I have to figure that out.
How can I fetch each value and add it to each input which uses state.
Here is an example of the state:
const [address, setAddress] = useState(shippingAddress.address);
const [city, setCity] = useState(shippingAddress.city);
const [state, setState] = useState(shippingAddress.state)
const [postalCode, setPostalCode] = useState(shippingAddress.postalCode);
const [country, setCountry] = useState(shippingAddress.country);
The text was updated successfully, but these errors were encountered: