title: How to include the Match object into a Reacts component class?
body: <p>I am using react router v5, and trying to get URL parameters by props match object into my react component class. However it is not working! What am I doing wrong here?</p>
  <p>When I create my component as a JavaScript function it all works fine, but when I try to create my component as a JavaScript class it doesn't work.</p>
  <p>Perhaps I am doing something wrong? How do I pass the Match object in to my class component and then use that to set my component's state?</p>
  <p>here code:</p>
  <pre><code>import React, { Component } from 'react';   
  
  import { Link} from &quot;react-router-dom&quot;;
  
  export class JobDetail extends Component {  
  
      state = {
         // jobsData: [],
  
      }
      async componentDidMount() {
  
          const props = this.props.match;
          console.log(&quot;---props data---&quot;,props);  // it's showing undefined 
  
      }
  
  
      render() {  
          return (  
              &lt;&gt;
                  test message 
              &lt;/&gt; 
  
          )  
      }  
  }  
    
  export default JobDetail
  </code></pre>