React framework
Add automatic MyOG.social images to React Router Framework Mode routes with meta exports, loaders, and pre-rendered or server-rendered HTML.
React Router Framework Mode renders route metadata from each route module's meta export.
MyOG works best when those meta descriptors are present in the initial HTML response, so social crawlers can read og:image without running client-side JavaScript.
Use loader data or route params to build the canonical page URL, then return Open Graph and Twitter image descriptors from meta.
MyOG detects page content and branding automatically. The layout only controls image composition.
Use this in a public Framework Mode route module.
Preview anonymously. Sign in to get complete install code for your account.
Sign in to get install codeReplace the encoded example URL with the route's final canonical URL.
Use loader data when the canonical URL depends on route params or content records.
Preview anonymously. Sign in to get complete install code for your account.
Sign in to get install codeKeep the canonical URL stable across trailing slashes, locale prefixes, and redirects.
If your root route, parent route, or SEO helper already returns og:image, merge metadata carefully and keep only one preferred image for a page. React Router nested routes can override or replace parent metadata depending on how your meta functions are composed.
Dynamic routes should build the MyOG url parameter from the final canonical URL, not from a client-side location value. Use loader data for slugs, locale prefixes, or canonical aliases when the request path is not the URL you want shared.
Start with the MyOG Open Graph Checker, then refresh social platform caches if needed.
Sign up for free and add generated social images to React Router routes.
Already have an account?
9355e1d0af85531fec59b28108cfa489a0cb1a32