T
TanStack3y ago
quickest-silver

How to pass multiple variables using loaders with router?

Looking at this example
getContext: ({ params: { postId } }) => {
return {
loaderOptions: createLoaderOptions({
key: 'post',
variables: postId,
}),
}
},
getContext: ({ params: { postId } }) => {
return {
loaderOptions: createLoaderOptions({
key: 'post',
variables: postId,
}),
}
},
Why variables is in plural but accept only one string? what if I want tp pass search params?
2 Replies
quickest-silver
quickest-silverOP3y ago
ok, got it, variables could be anything string, object, array ....
optimistic-gold
optimistic-gold3y ago
Yep!

Did you find this page helpful?