@@ -247,12 +247,12 @@ export const Route = createFileRoute('/posts/$postId/edit')({
247
247
248
248
function EditPost() {
249
249
const navigate = useNavigate ()
250
-
250
+
251
251
const handleSubmit = async (formData ) => {
252
252
const result = await updatePost (params .postId , formData )
253
253
navigate ({ to: ' /posts/$postId' , params: { postId } })
254
254
}
255
-
255
+
256
256
return <form onSubmit ={handleSubmit}>{/* form */ }< / form >
257
257
}
258
258
```
@@ -282,11 +282,11 @@ TanStack Router has built-in SSR capabilities. Set up your router for SSR:
282
282
import { createRouter } from ' @tanstack/react-router'
283
283
import { routeTree } from ' ./routeTree.gen'
284
284
285
- const router = createRouter ({
285
+ const router = createRouter ({
286
286
routeTree ,
287
287
context: {
288
288
// Add any SSR context here
289
- }
289
+ },
290
290
})
291
291
292
292
declare module ' @tanstack/react-router' {
@@ -709,16 +709,16 @@ Before deploying your migrated application:
709
709
710
710
## React Router v7 vs TanStack Router Feature Comparison
711
711
712
- | Feature | React Router v7 | TanStack Router |
713
- | ---------| ----------------| -----------------|
714
- | Type Safety | Good | Excellent |
715
- | File-based Routing | Framework mode only | Built-in |
716
- | Search Params | Basic | Validated with schemas |
717
- | Code Splitting | Good | Excellent with lazy routes |
718
- | SSR | Framework mode | Built-in with TanStack Start |
719
- | Bundle Size | Larger | Smaller |
720
- | Learning Curve | Moderate | Moderate |
721
- | Community | Large | Growing |
712
+ | Feature | React Router v7 | TanStack Router |
713
+ | ------------------ | ------------------- | ---------------------------- |
714
+ | Type Safety | Good | Excellent |
715
+ | File-based Routing | Framework mode only | Built-in |
716
+ | Search Params | Basic | Validated with schemas |
717
+ | Code Splitting | Good | Excellent with lazy routes |
718
+ | SSR | Framework mode | Built-in with TanStack Start |
719
+ | Bundle Size | Larger | Smaller |
720
+ | Learning Curve | Moderate | Moderate |
721
+ | Community | Large | Growing |
722
722
723
723
---
724
724
@@ -729,7 +729,7 @@ After successfully migrating to TanStack Router, consider these enhancements:
729
729
### Advanced Features to Explore
730
730
731
731
- ** Route-based code splitting** - Improve performance with lazy loading
732
- - ** Search parameter validation** - Type-safe URL state management
732
+ - ** Search parameter validation** - Type-safe URL state management
733
733
- ** Route preloading** - Enhance perceived performance
734
734
- ** Route masking** - Advanced URL management
735
735
- ** Integration with TanStack Query** - Powerful data fetching
@@ -743,4 +743,4 @@ After successfully migrating to TanStack Router, consider these enhancements:
743
743
- [ Navigation Guide] ( ../guide/navigation.md ) - Complete navigation patterns
744
744
- [ Search Parameters Guide] ( ../guide/search-params.md ) - Advanced search param usage
745
745
- [ Type Safety Guide] ( ../guide/type-safety.md ) - TypeScript integration details
746
- - [ React Router v7 Changelog] ( https://reactrouter.com/start/changelog ) - What changed in v7
746
+ - [ React Router v7 Changelog] ( https://reactrouter.com/start/changelog ) - What changed in v7
0 commit comments