title: this.props.match.params.id in React.js is undefined
body: <p>I want to get the id from the URL therefore I can use this id to get and output the user info but I can't get id from URL. I've seen useParams() but I think it is not applicable with class component. May I know if there is an alternative solution for this?</p>
  <pre><code> async componentDidMount(){
      const stud_id = this.props.match.params.id;
      console.log(stud_id);
   }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/0NfwO.png" rel="nofollow noreferrer">see error message from console here</a></p>