Home > Back-end >  React uncaught type error: Cannot read properties of undefined reading params
React uncaught type error: Cannot read properties of undefined reading params

Time:02-21

enter image description here enter image description here

enter image description here

My Page is showing blank. please help me to fix this problem

CodePudding user response:

You already imported useParams from react-router-dom, so you need to add

const { nftId } = useParams();

instead of using match.params.nftId

Then you can put a condition like if (nftId) { your code here }

  • Related