Skip to content

Instantly share code, notes, and snippets.

@wickedev
Last active July 26, 2021 11:13
Show Gist options
  • Save wickedev/3f58ea25686da67e4f988c272b9bf7ef to your computer and use it in GitHub Desktop.
Save wickedev/3f58ea25686da67e4f988c272b9bf7ef to your computer and use it in GitHub Desktop.
react-router generic Location hack
/// <reference types="react-scripts" />
declare module 'react-router' {
import type { Location, State } from 'history'
export type * from 'react-router'
export declare function useLocation<S extends State = State>(): Location<S>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment