import { json, LoaderFunction } from "remix";
      import invariant from "tiny-invariant";
      export const loader = async ({ params }) => {
        invariant(, "expecting an identifier");
        return json(await getDataById(id));

      Javascript language logo
      your recipe card header background
      Loader with Parameters

      Remix JavaScript public recipes

      Defines a loader function that fetch data from an API using the getDataById function.

      Shortcut: remix.loader.params


        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.