Skip to main content
Version: next

createHandle

Since version 3.5

info

The createHandle is used for the Remix Route handle export

Arguments:

NameTypeDescription
dynamicRouteDynamicRouteHandleThe dynamic route configuration
getSitemapEntriesfunctionAllows to retrieve sitemap entries from a remix route
sitemapFetcherstringAllows to retrieve sitemap entries from a registered fetcher

Example:

import { createHandle } from "@front-commerce/remix/handle";

export const handle = createHandle({
dynamicRoute: {
type: "product", // required
priority: 1, // optional
},
sitemapFetcher: "product",
getSitemapEntries: async () => {
return [
{
loc: "/acme-product.html",
lastmod: new Date().toISOString(),
changefreq: "daily",
priority: 1,
},
];
},
});