I want to access to these array location attributes and How to pass loaction to the setstate and display them inside the return state (react functional component used)
Advertisement
Answer
since response.data.exsitingSupplierDetails
is an Array of length = 1
, you can access the location
like this:
response.data.exsitingSupplierDetails[0].location