This is my URL in react js
http://localhost:3000/meassger/student/1
I want to extract 1 from the URL if it was a functional component I could have used ```useParams``
I am getting this error
TypeError: Cannot read properties of undefined (reading 'params')
componentDidMount() {
console.log(this.props.match.params.id, "");
};