Javascript – onClick triggering page refresh and setting page params from useParams hook as 'undefined'
I have an interesting problem. I have a product page and an 'add item' button. When the button is clicked the product id will be updated in the 'items' array state variable. I'm getting the product id from the url…