in class component "this.props.match.params" is not working in 6.0.0 react-route-dom #8404
-
in class component "this.props.match.params" is not working in 6.0.0 react-route-dom import React,{ Component } from 'react'; class Customer extends Component{
} export default Customer; |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
running into same issue. do u have any solution? |
Beta Was this translation helpful? Give feedback.
-
This isn't a feature in v6. You need to use hooks or use a wrapper around your class components to provide the hook data to them. |
Beta Was this translation helpful? Give feedback.
-
On this page you will find the solution that, although a bit long, worked for me with react-router-dom 6.14.2 |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Just watch this 9-minute tutorial. |
Beta Was this translation helpful? Give feedback.
This isn't a feature in v6. You need to use hooks or use a wrapper around your class components to provide the hook data to them.