Skip to content

Free, simple, and intuitive online database diagram editor and SQL generator.

305 B
Raw Blame
import { useCallback } from "react";
import { useNavigate } from "react-router-dom";

export default function useNavigateWithParams() {
  const navigate = useNavigate();

  return useCallback(
    (to, options = {}) => {
      navigate(to + window.location.search, options);
    },
    [navigate],
  );
}