How to use the @reach/router.globalHistory.listen function in @reach/router

To help you get started, we’ve selected a few @reach/router examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github reach / router / examples / crud / src / App.js View on Github external
// Fast network always
// slow initial load
// show loading quickly on initial load, don't show top level placeholder on navigation
import React from "react";
import { Router, Link, Redirect, globalHistory } from "@reach/router";
import {
  login,
  getContacts,
  getContact,
  createContact,
  updateContact,
  deleteContact
} from "./utils";
import createContext from "create-react-context";

globalHistory.listen(({ location, action }) => {
  console.log({ location, action });
});

const InvalidateContacts = createContext();
const withInvalidateContacts = Comp => props => (
  
    {invalidate => }
  
);

const NavLink = props => (
   ({
      className: isPartiallyCurrent ? "nav-link active" : "nav-link"
    })}
    {...props}
github bvaughn / react-devtools-tutorial / src / hooks.js View on Github external
      subscribe: callback => globalHistory.listen(callback),
    }),