Replies: 3 comments 15 replies
-
Is there a reason why we don't get the request object in meta? It's always a bit odd to me, how different the props are between all the Remix server exports. |
Beta Was this translation helpful? Give feedback.
-
MetaFunction runs client side, so it can't have access to the request. Instead you should return from the loader whatever your MetaFunction needs, eg return request.url or even better the og:image value. |
Beta Was this translation helpful? Give feedback.
-
So, how do I read some content from a |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
This problem showed up when needing to generate Open Graph tags like
og:image
orog:url
. These take a url in the form ofhttp(s)://host/pathname
. As these are generated in themeta
function it would be handy to have access to the request, so we could parse out the hostname. Currently we only have thepathname
frommatches
orlocation
.The current workaround for me and others (https://discord.com/channels/770287896669978684/1193584644994629702) is to parse the parameters out of the request in the root loader and then access it via the
matches[0].data
.Beta Was this translation helpful? Give feedback.
All reactions