click-should-be-intercepted-for-navigation
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

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

Package Sidebar

Install

npm i click-should-be-intercepted-for-navigation

Weekly Downloads

0

Version

1.1.0

License

CC0-1.0

Unpacked Size

1.95 kB

Total Files

4

Last publish

Collaborators

  • tehshrike