Skip to content
Source
Sign inSign up
TanStack/router
Open History to see the last commit

matchContext.tsx

15 lines461 Bytes

1import * as Solid from 'solid-js'
2import type { AnyRouteMatch } from '@tanstack/router-core'
3​
4export type NearestMatchContextValue = readonly [
5 routeId: Solid.Accessor<string | undefined>,
6 match: Solid.Accessor<AnyRouteMatch | undefined>,
7]
8​
9const defaultNearestMatchContext: NearestMatchContextValue = [
10 () => undefined,
11 () => undefined,
13​
14export const nearestMatchContext =
15 Solid.createContext<NearestMatchContextValue>(defaultNearestMatchContext)