T
TanStack7mo ago
rival-black

Page title based on loaderData

Hello, is there any way i can put some data into a title? In a Route Component u would use
const employee: Employee = Route.useLoaderData();
const employee: Employee = Route.useLoaderData();
And then - employee.name, I want the name to be in the title using the Tanners solution with usage of a "head" function. I am using just TanStack Router not the TanStack Start.
No description
4 Replies
rival-black
rival-blackOP7mo ago
As soon as i posted this i figured out a solution, so if someone wonders how to do it:
No description
quickest-silver
quickest-silver7mo ago
why do you have to type cast here?
rival-black
rival-blackOP7mo ago
Oh.. you probably don't need to. The loaderData already have the correct type without the "type cast"
quickest-silver
quickest-silver7mo ago
yep

Did you find this page helpful?