I'm trying to disable my Header and Footer components on my Product page. Here is my code:
const HeaderRoute = useCallback(
() =>
!["/create", "/sign-up", "/sign-in", "/product"].includes(
window.location.pathname
) && <Header />,
[]
);
However, my Product component url contains custom :id or path="/product/:id" :
<Route exact path="/product/:id" component={Product} />
The header doesn't render on the other urls, but it does on the /product:id url for some reason. Any ideas why?