TypeError:Cannot read property 'map' of undefined in reactjs
问题 I'm using React.js. I want to use the data I have captured in Mock Api in product detail in an e-commerce site, but I get the following error. My goal here is to extract and print data from Mock API in ProductDetail. ProducDetail.js; const ProductDetail = (props) => { const { name, description, price } = props; const axios = require('axios'); const [dress, setDress] = useState([]); useEffect(() => { axios .get(`{url}`) .then(function (response) { setDress(response.data.dress); }) .catch