Back to React Router

renderMatches

docs/api/utils/renderMatches.md

7.6.2970 B
Original Source

renderMatches

<!-- ⚠️ ⚠️ IMPORTANT ⚠️ ⚠️ Thank you for helping improve our documentation! This file is auto-generated from the JSDoc comments in the source code, so please edit the JSDoc comments in the file below and this file will be re-generated once those changes are merged. https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/components.tsx -->

[MODES: framework, data, declarative]

Summary

Reference Documentation ↗

Renders the result of matchRoutes into a React element.

Signature

tsx
function renderMatches(
  matches: RouteMatch[] | null,
): React.ReactElement | null

Params

matches

The array of route matches to render

Returns

A React element that renders the matched routes or null if no matches