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 { Redirect as RouterRedirect } from 'react-router-dom';
import type { To } from './types';
import { withState } from './utils';
export interface RedirectProps {
to: To;
/**
* Defaults to `true`, matching v5's `<Redirect>`. v6's `<Navigate>` pushes
* unless told otherwise, which is invisible until someone presses Back.
*/
replace?: boolean;
state?: unknown;
}
export function Redirect({
to,
replace = true,
state,
}: RedirectProps): JSX.Element {
return <RouterRedirect to={withState(to, state)} push={!replace} />;
}
Redirect.defaultProps = {
replace: true,
state: undefined,
};