Access page context in links function #1258
-
Hi everyone, I see we can get the loader data in the Why can't we do the same in the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
We used to have it but removed it, the reasoning is found in the 0.19 release notes under "Removal of data in links({ data })": https://github.com/remix-run/remix/releases/tag/v0.19.0#:~:text=Removal%20of%20data%20in%20links(%7B%20data%20%7D) |
Beta Was this translation helpful? Give feedback.
-
You can use the useMatches hook to add those Use the useMatches to access the data of each route loader, and get the resources you need, then render the link tags. |
Beta Was this translation helpful? Give feedback.
You can use the useMatches hook to add those
<link rel="preload" />
in the of your document.Use the useMatches to access the data of each route loader, and get the resources you need, then render the link tags.