问题:
With react-router
I can use the Link
element to create links that are natively handled by react router. 通过react-router
我可以使用Link
元素来创建由react路由器本地处理的链接。
I see internally it calls this.context.transitionTo(...)
. 我在内部看到它调用this.context.transitionTo(...)
。
I want to do a navigation, but not from a link, from a dropdown selection for example. 我想从下拉列表中进行导航,而不是从链接进行导航。 How can I do this in code? 如何在代码中执行此操作? What is this.context
? 这是什么this.context
?
I saw the Navigation
mixin, but can I do this without mixins? 我看到了Navigation
混合器,但是没有混合器可以做到吗?
解决方案:
参考一: https://stackoom.com/question/26P5V/使用React-Router以编程方式导航参考二: https://oldbug.net/q/26P5V/Programmatically-navigate-using-react-router
来源:oschina
链接:https://my.oschina.net/u/4437974/blog/4487201