我正在尝试执行 this.props.history.push("/payment/"+ stripe_plan_id)
Gastby 中的 this.props.history.push 相当于什么?
我收到错误TypeError:无法读取未定义的属性“push”
最佳答案
最上面的答案不再有效,但这确实有效:
import { navigate } from "gatsby"
navigate(`/payment/${stripe_plan_id.id}`)
关于reactjs - gatsby 中的 this.props.history.push 相当于什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58677568/