How can I access array data inside my json object data?
const [data, setData] = useState([])
const getData = () => {
axiosInstance
.get(url + slug)
.then(result => setData(result.data))
}
useEffect(() => {
getData()
}, [])
Here are something I've tried:
console.log(data['symbol'])
console.log(data[0]['symbol'])
console.log(data[0].symbol)
Here is the data being used in my state:

To keep it simple, lets say I want to the access first array, and console log all values for symbol. How would I go about doing that?
Uncaught TypeError: Cannot read property '0' of undefineddatais empty on the first render, so will throw an error. Also, you should either addgetDatato youruseEffectdependency array, or move it inside.if (data.length){console.log(...);}