import { useHistory, useLocation } from "react-router-dom";
export default function useCustomHistory() {
    const customHistory = useHistory();
    const { state } = useLocation();
    return {
        ...customHistory,
        goBackWithFallback(fallbackRoute) {
            if (state?.internalNavigation)
                customHistory.goBack();
            else
                customHistory.push(fallbackRoute);
        }
    };
}
//# sourceMappingURL=useCustomHistory.js.map