Skip to content

link vs meta parameters #13239

Answered by sergiodxa
masterpuppet asked this question in Q&A
Mar 17, 2025 · 1 comments · 1 reply

You must be logged in to vote

MetaFunction depends on your loader data, so you can set metatags, and even link tags, based on data.

LinksFunction doesn't depend on loader data, this allows the router to statically know them (not really static as it needs to call a function but that functions always returns the same links). This is useful for the router because if you use <Link to="/path" prefetch="intent">Go to /path</Link> then the router can prefetch assets you linked in your LinksFunction.

For example, if in your LinksFunction you have a link to prefetch the hero image of a route, and load some CSS file, when you render a link to to that route the router can use the result of the route LinksFunction to prefetch the…

Replies: 1 comment 1 reply

You must be logged in to vote
1 reply
@masterpuppet

Answer selected by masterpuppet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants