0.1.3 • Published 7 months ago

@remix-run/v1-meta v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

V1 Meta

Enables the v1 route meta API in Remix v2.

import { metaV1, getMatchesData } from "@remix-run/v1-meta";

export const meta = (args) => {
  // In the v1 API, `meta` received a `parentsData` argument, which is an
  // object keyed by each parent route ID containing the data returned by
  // that route's `loader` function. This argument is removed from the
  // v2 API. `getMatchesData` will construct an object with the same
  // signature, allowing you to easily refactor your code.
  let matchesData = getMatchesData(args);
  let rootData = matchesData["root"];

  // This function will construct an array of `V2_MetaDescriptor` objects.
  // It will use the same heuristics as Remix v1 to merge the parent
  // route's meta values with the data you provide.
  return metaV1(args, {
    title: "My App",
    description: "My App Description",
  });

  // output:
  return [
    // This is inherited from the parent route!
    { charSet: "utf-8" },
    // If your parent has a title it will be overridden!
    { title: "My App" },
    { name: "description", content: "My App Description" },
  ];
};
0.1.2

8 months ago

0.1.2-pre.0

8 months ago

0.1.3-pre.0

7 months ago

0.1.3

7 months ago

0.1.1

1 year ago

0.1.0

1 year ago

0.1.0-pre.2

1 year ago

0.1.0-pre.1

1 year ago

0.1.0-pre.0

1 year ago