Skip to content

Commit 109ea06

Browse files
authored
Update TanStack Router example in docs (#6700)
1 parent 546ffa4 commit 109ea06

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/dev/docs/pages/react-aria/routing.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -273,13 +273,13 @@ export default function App() {
273273
To use [TanStack Router](https://tanstack.com/router) with React Aria, render React Aria's `RouterProvider` inside your root route. Use `router.navigate` in the `navigate` prop, and `router.buildLocation` in the `useHref` prop. You can also configure TypeScript to get autocomplete for the `href` prop by declaring the `RouterConfig` type using the types provided by TanStack Router.
274274

275275
```tsx
276-
import {useRouter, type RegisteredRouter, type NavigateOptions, type ToOptions} from '@tanstack/react-router';
276+
import {useRouter, type NavigateOptions, type ToOptions} from '@tanstack/react-router';
277277
import {RouterProvider} from 'react-aria-components';
278278

279279
declare module 'react-aria-components' {
280280
interface RouterConfig {
281-
href: ToPathOption<RegisteredRouter['routeTree']>;
282-
routerOptions: Omit<NavigateOptions, keyof ToOptions>
281+
href: ToOptions['to'];
282+
routerOptions: Omit<NavigateOptions, keyof ToOptions>;
283283
}
284284
}
285285

packages/dev/docs/pages/react-spectrum/routing.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -275,13 +275,13 @@ export default function App() {
275275
To use [TanStack Router](https://tanstack.com/router) with React Spectrum, render React Spectrum's `Provider` inside your root route. Use `router.navigate` in the `navigate` prop, and `router.buildLocation` in the `useHref` prop. You can also configure TypeScript to get autocomplete for the `href` prop by declaring the `RouterConfig` type using the types provided by TanStack Router.
276276

277277
```tsx
278-
import {useRouter, type RegisteredRouter, type NavigateOptions, type ToOptions} from '@tanstack/react-router';
278+
import {useRouter, type NavigateOptions, type ToOptions} from '@tanstack/react-router';
279279
import {Provider, defaultTheme} from '@adobe/react-spectrum';
280280

281281
declare module '@adobe/react-spectrum' {
282282
interface RouterConfig {
283-
href: ToPathOption<RegisteredRouter['routeTree']>;
284-
routerOptions: Omit<NavigateOptions, keyof ToOptions>
283+
href: ToOptions['to'];
284+
routerOptions: Omit<NavigateOptions, keyof ToOptions>;
285285
}
286286
}
287287

0 commit comments

Comments
 (0)