TreeRoutercomponent

TreeRouter({ fallback, ...meta }: TreeRouterProps): ReactNode
ParamType
metaTreeRouterProps
Props for the TreeRouter component — the tree to route plus an optional fallback and app meta. required
    .fallbackReactElement
null
Optional fallback element.
- Explicit null means fallback to nothing (router will not throw NotFoundError). readonly
Return
ReactNode
Throws
unknown
NotFoundError When no element matches the URL and no fallback is given.

Resolve a URL path to a tree element and render it as a full page.

  • Reads the flattened path → element map from the surrounding <TreeProvider> (useTreeMap()), then resolves the current URL with a single map.get(path).
  • / renders the root itself; deeper paths render the matching descendant (composite module names like /util/string resolve for free — they're whole keys in the map).
  • The resolved element is already stamped with its canonical path, so the page and its cards link straight to their own paths — nothing needs threading.
  • To override the renderer for a specific element type, wrap in <TreeRouterMapping mapping={…}>.

Examples

<TreeProvider tree={tree}><TreeRouter /></TreeProvider>