MCPcopy Create free account
hub / github.com/freeCodeCamp/freeCodeCamp / createRedirect

Function createRedirect

client/src/components/create-redirect.ts:5–11  ·  view source on GitHub ↗
(to = '/')

Source from the content-addressed store, hash-verified

3
4const createRedirect =
5 (to = '/'): ((_props: RouteComponentProps) => JSX.Element | null) =>
6 () => {
7 if (typeof window !== 'undefined') {
8 void navigate(to);
9 }
10 return null;
11 };
12
13export default createRedirect;

Calls

no outgoing calls

Tested by

no test coverage detected