UNPKG

react-router-last-location

Version:

Provides access to the last location in react + react-router (v4.x) apps. Useful for handling internal routing. Easily prevent leaving your app by users.

7 lines (5 loc) 182 B
import { useContext } from 'react'; import LastLocationContext from './LastLocationContext'; export default function useLastLocation() { return useContext(LastLocationContext); }