I have a problem like this. I am developing a React application. There is an Url like this
http://localhost:3000/drivershow/0x6E2C0A2f1a7e8fb7C33b3826FF14F95C90535557
I want to access the 0x6E2C0A2f1a7e8fb7C33b3826FF14F95C90535557 part from the URL. To do that I have tried something like this by following some question in the StackOverflow.
import React, { Component } from 'react';
import queryString from 'query-string'
class DriversShow extends Component{
async componentDidMount(props){
const values = queryString.parse(this.props.location.search)
console.log(values);
}
render(){
return(
<div>Haiiiiiiiiii</div>
);
}
}
export default DriversShow;
But it consoles log undefined. Can someone help me to solve this problem? I tried some other examples by searching in the Google but those were unable to make a sense. Thank You!!