Hey I have a question how can we catch the id from url
onProductClick = item => {
this.props.history.push(`/product/${item.id}`);
};
How can we assign this coming id from url to variable in react
This is the place i've planned to catch the id valuer
class ProductView extends React.Component {
componentDidMount() {
let someVar = this.props.location.pathname.split('/').pop()
console.log('router val ', someVar);}