Back to Refine

useBack Hook | Navigate Backwards in Refine v4

documentation/versioned_docs/version-4.xx.xx/routing/hooks/use-back/index.md

3.25.0387 B
Original Source

useBack is a hook that leverages the back method of the routerProvider to perform the "go back" operation in the history stack.

Usage

tsx
import { useBack } from "@refinedev/core";

const MyComponent = () => {
  const back = useBack();

  return <Button onClick={() => back()}>Go Back</Button>;
};