Skip to content

Commit 4235804

Browse files
vetledvZeeshanTambolimapache-salvaje
authored
[docs] Add TanStack Router routing example (#44930)
Signed-off-by: Vetle de Vries Brandth <[email protected]> Signed-off-by: Sam Sycamore <[email protected]> Co-authored-by: Zeeshan Tamboli <[email protected]> Co-authored-by: Sam Sycamore <[email protected]>
1 parent 904b1a8 commit 4235804

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

docs/data/material/integrations/routing/routing.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,24 @@ The [example folder](https://github.com/mui/material-ui/tree/HEAD/examples/mater
147147
);
148148
}
149149
```
150+
151+
### TanStack Router
152+
153+
TanStack Router supports custom links through its `createLink` helper function.
154+
The snippet below shows the most basic implementation, wrapping a Material UI Link component.
155+
See [TanStack Router—Custom Link](https://tanstack.com/router/latest/docs/framework/react/guide/custom-link) for more component integration examples.
156+
157+
```tsx
158+
import { createLink } from '@tanstack/react-router';
159+
import { Link as MUILink } from '@mui/material';
160+
161+
const CustomLink = createLink(MUILink);
162+
163+
function App() {
164+
return (
165+
<CustomLink underline="none" to="/about">
166+
Link to about page
167+
</CustomLink>
168+
);
169+
}
170+
```

0 commit comments

Comments
 (0)