Create Component with loader function

    0

    1

    Jose Romero

    Remix JavaScript public recipes

    Create a default remix component with a loader function.

    Library: remix

    Shortcut: remix.component.loader

    import { json, LoaderFunction, useLoaderData } from "remix";
    
    export const loader = async ({ params }) => {
      const myData = {};
      return json(myData);
    };
    export default function Component() {
      const data = useLoaderData();
      return <main></main>;
    };
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.