T
TanStack14mo ago
adverse-sapphire

How do I access route context in a Route's meta()?

If I use
meta: ({match: { routeContext: { someField } } }) => { ... }
meta: ({match: { routeContext: { someField } } }) => { ... }
or
meta: ({match: { context : { someField } } }) => { ... }
meta: ({match: { context : { someField } } }) => { ... }
... in both cases, they are undefined. I do not want to have the data I am accessing in meta be returned in the loader, because the data was loaded in a parent match's beforeLoad function. Having the data returned in loader will serialize it to the client and cause the data to be duplicated in the initial SSR'd HTML payload.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?