SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.
TypeScript apmapplication-monitoringdistributed-tracinggogood-first-issuejaegerloglogsmetricsmonitoringnextjsobservabilityopen-sourceopentelemetryprometheusreactreactjsself-hostedtracingtypescript
import { useCallback } from 'react';
import { useHistory } from 'react-router-dom';
import type { NavigateFn, NavigateOptions, To } from './types';
import { applyNavigate } from './utils';
/**
* Hook-context imperative navigation, for `useHistory()` call sites that only
* push or replace. Prefer `useSafeNavigate` when the call site wants same-URL
* suppression or new-tab handling.
*/
export function useAppNavigate(): NavigateFn {
const history = useHistory();
return useCallback(
(to: To, options?: NavigateOptions): void => {
applyNavigate(history, to, options);
},
[history],
);
}