diff --git a/packages/inferno-router/__tests__/NavLink.spec.tsx b/packages/inferno-router/__tests__/NavLink.spec.tsx index 0e856222d..6ccde186d 100644 --- a/packages/inferno-router/__tests__/NavLink.spec.tsx +++ b/packages/inferno-router/__tests__/NavLink.spec.tsx @@ -460,7 +460,7 @@ describe('NavLink', () => { key: '1', pathname: '/the/path', search: 'the=query', - state: null, + state: null }; render( @@ -477,7 +477,7 @@ describe('NavLink', () => { it('accepts an object `to` prop with state', async () => { const memoryHistoryFoo = createMemoryHistory({ - initialEntries: ["/foo"] + initialEntries: ['/foo'] }); memoryHistoryFoo.push = jasmine.createSpy(); @@ -517,7 +517,7 @@ describe('NavLink', () => { tmpNode ); - const a = tmpNode.querySelector("a"); + const a = tmpNode.querySelector('a'); a.click(); expect(clickHandler).toHaveBeenCalledTimes(1); diff --git a/packages/inferno-router/src/Link.ts b/packages/inferno-router/src/Link.ts index b1bc5e248..0c9c71062 100644 --- a/packages/inferno-router/src/Link.ts +++ b/packages/inferno-router/src/Link.ts @@ -4,8 +4,7 @@ import { invariant } from './utils'; import { combineFrom, isString } from 'inferno-shared'; import type { Location } from 'history'; import { parsePath } from 'history'; -import { splitLocation, normalizeToLocation } from "./locationUtils"; - +import { splitLocation, normalizeToLocation } from './locationUtils'; const isModifiedEvent = (event: InfernoMouseEvent): boolean => Boolean(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); @@ -36,7 +35,6 @@ function handleClick({ props, context }, event: InfernoMouseEvent) { const { replace = false, to: toPropIn } = props; const { to, state } = splitLocation(normalizeToLocation(toPropIn)); - if (replace) { history.replace(to, state); } else { diff --git a/packages/inferno-router/src/locationUtils.ts b/packages/inferno-router/src/locationUtils.ts index 86985ea45..a193a88f4 100644 --- a/packages/inferno-router/src/locationUtils.ts +++ b/packages/inferno-router/src/locationUtils.ts @@ -1,11 +1,11 @@ -import { To, Location, parsePath } from "history"; +import { To, Location, parsePath } from 'history'; import { isString } from 'inferno-shared'; export const normalizeToLocation = (to) => { return isString(to) ? parsePath(to) : to; }; -export const splitLocation = (location: Location): { to: To, state: any} => { - const { key = '', state, ...to } = location; - return { to, state }; -} \ No newline at end of file +export const splitLocation = (location: Location): { to: To; state: any } => { + const { key = '', state, ...to } = location; + return { to, state }; +};