Router

RouterContext

React context carrying path params navigate manicjs/router advanced integrations.

RouterContext

Low-level createContext exported for advanced integrations (multiple routers in tests, DevTools, custom wrappers). Most apps should call useRouter() instead.

import { RouterContext } from 'manicjs/router';

Provided value (RouterContextValue)

Prop

Type


Usage pattern

import React, {  } from 'react';
import {  } from 'manicjs/router';

export function () {
  const  = ();
  if (!) return null;
  return <>{.}</>;
}

Prefer useRouter() — it throws when rendered outside Router.


See also

On this page