0
I would like to use a function that is within a class, but I would like this function to use the props.match.params
to rescue the id
of the product in the URL, to know which product the function will handle and etc.
class Exemplo{
exemplo(){
const id = props.match.params
return console.log(id)
}
}
export default new Exemplo()
When I try to execute a code similar to this, type error "props Undefined"
Your routes are configured?
– novic
Just remembering that the props is in context
this.props
. React props– Chance