简体   繁体   中英

Uncaught TypeError: Cannot read properties of undefined (reading 'params')?

I creating product details page But there is an error match is undefined, where is mistake?

enter image description here where is mistake?

enter image description here

You try to access match.params.id in ProductDetails.js line 238 but you no provide match prop in <ProductDetails > in App.js line 29. So the code try to access a null prop.

Try to add match prop in <ProductDetails > component.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM