click-should-be-intercepted-for-navigation
v1.1.0
Published
Given a click event, returns true if it's a left-click that you should intercept to trigger pushState navigation
Downloads
7
Maintainers
Readme
Given a click event, returns true if it's a left-click that you should intercept to trigger pushState navigation.
Taken from React Router's Link component.
const shouldInterceptClick = require('click-should-be-intercepted-for-navigation')
function onClick(event) {
if (shouldInterceptClick(event)) {
// do your pushState-based navigation here
}
}