How can we pass parameter with this.props.history.push(\'/page\')
in React-Router v4?
.then(response => {
var r = this;
if (re
If you need to pass URL params
theres a great post explanation by Tyler McGinnis on his site, Link to the post
here are code examples:
on the history.push component:
this.props.history.push(`/home:${this.state.userID}`)
on the router component you define the route:
on the Home component:
componentDidMount(){
const { myKey } = this.props.match.params
console.log(myKey )
}