The useChildMatches hook returns all of the child RouteMatch objects from the closest match down to the leaf-most match. It does not include the current match, which can be obtained using the useMatch hook.
The result is derived from the router's current match presentation. It can include still-loading descendants and descendants below the current render boundary.
The useChildMatches hook accepts a single optional argument, an options object.
import { useChildMatches } from '@tanstack/react-router'
function Component() {
const childMatches = useChildMatches()
// ...
}