DEV Community

Discussion on: React Router - How to pass History object to a component

Collapse
 
jasterix profile image
Jasterix

this was such a life saver! Do you mind explaining why this.props.history.push("/home") might result in undefined but this would work?

I think it has something to do with this line--With its help, you can pass the whole history object to your component as properties.-- but am not 100% sure.