} />
Id" element={ } />
What is the easiest way to access Id parameter from Menu component?
UseParams can only be used in element rendered by route.
I am currently doing this:
const location = useLocation();
const Id = location.pathname.split("/")[2]
This is however not rigid enough for me I think. I want the react way of retrieving the Id Param please - no fancy solutions please, the simplest way to do this.
