Skip to content

Commit

Permalink
Extends onClick event instead of override it (#4999)
Browse files Browse the repository at this point in the history
  • Loading branch information
valse authored and KyleAMathews committed Apr 16, 2018
1 parent 8680988 commit e83dc39
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/gatsby-plugin-google-analytics/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ function OutboundLink(props) {
<a
{...props}
onClick={e => {
if (typeof props.onClick === `function`) {
props.onClick()
}
let redirect = true
if (
e.button !== 0 ||
Expand Down Expand Up @@ -47,6 +50,7 @@ function OutboundLink(props) {
OutboundLink.propTypes = {
href: PropTypes.string,
target: PropTypes.string,
onClick: PropTypes.func,
}

export { OutboundLink }

0 comments on commit e83dc39

Please sign in to comment.