"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useHistoryConsistentPush = useHistoryConsistentPush;
const react_router_dom_1 = require("react-router-dom");
function useHistoryConsistentPush() {
    const navigate = (0, react_router_dom_1.useNavigate)();
    const location = (0, react_router_dom_1.useLocation)();
    return (pathname, preventScrollTop) => {
        navigate({
            pathname,
            search: location.search,
            hash: location.hash,
        }, {
            state: {
                preventScrollTop: {
                    [pathname]: preventScrollTop,
                },
            },
        });
    };
}
//# sourceMappingURL=HistoryConsistentPush.js.map