Replies: 2 comments
-
React 19 lets you render meta tags and the title tag at any place of the UI and it will move them to the document That said, aside of title, for most of them meta tags only matter for SSR as many consumers like social networks won't wait for a SPA to render, and since framework mode comes with SSR out of the box but data mode doesn't, that's most likely the reason meta tags are not part of data mode. |
Beta Was this translation helpful? Give feedback.
-
With React 19 there's still this Pitfall:
It would be very helpful for react-router to have a solution such that there's no need to think about pitfalls like this. Besides, this assumes people can freely update to React 19 to utilize that feature, which might not be the case for everyone. And from what I see react-router still seems to support React 18, which doesn't move meta tags to head. Currently I have to do it via handle like this and another option I was thinking about is using that React 19's feature. It is super cool that it's pretty easy to use react-router in data mode with custom SSR implementation, which can be used even in a service worker (I still can't decide if that's too much though 😄). I would hope there is at least a consideration to only make it easier and not harder over time. Adding direct And if that's something react-router really doesn't want to support directly, would turning |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently meta tags handling seems to be limited to framework mode only.
https://reactrouter.com/api/components/Meta
Is there a fundamental reason it can't be brought into
RouteObject
and then be handled in data mode as well?I understand there is
handle
, which can be used for anything, but an easier out-of-the-box way to handle meta tags could be very useful in data mode even in purely client-rendered context (even if just for controlling thetitle
, for example), but especially in data mode + custom framework case with SSR.Beta Was this translation helpful? Give feedback.
All reactions