1.1.0 • Published 2 years ago

click-should-be-intercepted-for-navigation v1.1.0

Weekly downloads
196
License
CC0-1.0
Repository
github
Last release
2 years ago

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