click-should-be-intercepted-for-navigation

Given a click event, returns true if it's a left-click that you should intercept to trigger navigation

Downloads
27
Stars
2
Committers
3

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
	}
}