React v5 to v6 update help with params update
Hello, dose anyone know a way to update v5
this.props.match.params.id into v6 which is import { useParams } from "react-router-dom"; but with out changing the class into a function? I tried to search for a way however I can't seem to find a solution for this.
Here is one of my code that needs to be updated
Here you can see that in const movieId = this.props.match.params.id; it has the this.props.match.params.id however that doesn't work anymore in v6.
It's in a class however I would like to keep it as a class and not changed it into a function if possible. Dose anyone know a way?
0 Replies