From 01aa1f9a47a18c21eb367db2223ec10da340b489 Mon Sep 17 00:00:00 2001 From: hbucius Date: Mon, 7 Aug 2017 19:01:41 +0800 Subject: [PATCH] fix no onclick bug on Link Component --- packages/react-server/core/components/Link.jsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react-server/core/components/Link.jsx b/packages/react-server/core/components/Link.jsx index 666226586..a79045531 100644 --- a/packages/react-server/core/components/Link.jsx +++ b/packages/react-server/core/components/Link.jsx @@ -8,6 +8,7 @@ module.exports = React.createClass({ propTypes: { path : React.PropTypes.string, href : React.PropTypes.string, + onClick : React.PropTypes.func, bundleData : React.PropTypes.bool, reuseDom : React.PropTypes.bool, className : React.PropTypes.string, @@ -39,6 +40,9 @@ module.exports = React.createClass({ bundleData, reuseDom, }); + if (this.props.onClick) { + this.props.onClick(e); + } } else { // do normal browser navigate }