↧
Answer by Mehdi Faraji for What's the equivalent of this.props.history.push...
The top answer doesn't work anymore But this does work :import { navigate } from "gatsby" navigate(`/payment/${stripe_plan_id.id}`)
View ArticleAnswer by ksav for What's the equivalent of this.props.history.push in gatsby?
Gatsby uses reach router. Try the following:import { navigate } from "@reach/router"navigate(`/payment/${stripe_plan_id.id}`)
View ArticleWhat's the equivalent of this.props.history.push in gatsby?
I'm trying to do this.props.history.push("/payment/"+ stripe_plan_id)What is the equivalent of this.props.history.push in Gastby?I get the error TypeError: Cannot read property 'push' of undefined
View Article