0
Fork 0
mirror of https://github.com/TanStack/router.git synced 2026-11-18 19:34:24 +00:00
router/docs/framework/react/api/router/createRouteMaskFunction.md
Sean Cassiere b5eabe19f5
docs: native markdown relative hyperlinks (#1998)
* docs: reference docs

* docs: guides

* docs: top-level

* docs: missed the route-trees

* docs: fixing routing-concepts
2024-07-20 18:23:45 +12:00

891 B

id title
createRouteMaskFunction createRouteMask function

The createRouteMask function is a helper function that can be used to create a route mask configuration that can be passed to the RouterOptions.routeMasks option.

createRouteMask options

  • Type: RouteMask
  • Required
  • The options that will be used to configure the route mask

createRouteMask returns

  • A object with the type signature of RouteMask that can be passed to the RouterOptions.routeMasks option.

Examples

import { createRouteMask, createRouter } from '@tanstack/react-router'

const photoModalToPhotoMask = createRouteMask({
  routeTree,
  from: '/photos/$photoId/modal',
  to: '/photos/$photoId',
  params: true,
})

// Set up a Router instance
const router = createRouter({
  routeTree,
  routeMasks: [photoModalToPhotoMask],
})