Javascript – I have a shopping app component that I only want to show on a particular page. Tried useLocation but the component has dynamic ids
I want to know how I can make my "page" variable in the below code dynamic, so I can properly compare it with the location.pathname variable which will have dynamic page ids. import { useLocation } from 'react-router-dom'; function AddToCart()…