react-router#__RouterContext TypeScript Examples

The following examples show how to use react-router#__RouterContext. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: useRouter.ts    From firetable with Apache License 2.0 5 votes vote down vote up
// used to transform routerContext into a hook
// TODO : find alternate solution as this uses an internal variable
export default function useRouter() {
  return useContext<RouteComponentProps<{ [key: string]: string }>>(
    __RouterContext
  );
}