title: How to include the Match object into a ReactJs component class?
body: <p>I am trying to use my url as a parameter by passing the 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>My code:</p>
  
  <pre><code>import React, { Component } from 'react';
  
  import axios from 'axios';
  
  import PropTypes from 'prop-types';
  
  class InstructorProfile extends Component {  
  
    constructor(props, {match}) {
  
      super(props, {match});
  
      this.state = {
          instructors: [],
          instructorID : match.params.instructorID
      };
  
    }
  
     componentDidMount(){
  
  
        axios.get(`/instructors`)
        .then(response =&gt; {
          this.setState({
            instructors: response.data
          });
        })
        .catch(error =&gt; {
          console.log('Error fetching and parsing data', error);
        });
      }
  
    render(){
      return (
        &lt;div className="instructor-grid"&gt;
  
          &lt;div className="instructor-wrapper"&gt;
  
         hi
  
          &lt;/div&gt;
  
        &lt;/div&gt;
      );
    }
  }
  
  export default InstructorProfile;
  </code></pre>