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.
If the router has pending matches and they are showing their pending component fallbacks, pending matches are used instead of active matches.
The useChildMatches hook accepts a single optional argument, an options object.
import { useChildMatches } from '@tanstack/react-router'
function Component() {
const childMatches = useChildMatches()
// ...
}