Slide 4
Slide 4 text
データ受け渡しとTanStack RouterのAPI
1.Path Params
- useParams
const postId = useParams({
from: '/posts/$postId',
select: (params) => params.postId,
})
2.Search Params
- useSearch
const selected = useSearch({
from: '/posts/$postId',
select: (search) => search.postView,
})
// ^ string