No, useParams is a hook and can only be used in functional components. For class components, you can use the withRouter higher-order component.