React-router Link组件防止子进程的默认值

Ale*_*hev 3 reactjs react-router

我正试图onClickLink孩子身上放置一个处理程序.问题是因为Link's transition方法没有解雇.有没有preventDefault?这是jquery世界中如何在点击子div时停止重定向父href标签的示例

tay*_*c93 8

来自onClick文档:

click事件的自定义处理程序.就像a标签上的处理程序一样工作- 调用e.preventDefault()将阻止从触发转换,同时e.stopPropagation()防止事件冒泡.

所以你应该能够使用 e.preventDefault

https://github.com/rackt/react-router/blob/master/docs/API.md#onclicke