How to get url params in react class component (router v6)?

 componentDidMount () { 
 

      this.props.match.params.id; 
//OR //
      this.props.history.replace('/notFound');



      
    }