import { json, LoaderFunction } from "remix";
      import invariant from "tiny-invariant";
      
      export const loader = async ({ params }) => {
        invariant(params.id, "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

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.