your recipe card header background

    Pending Link



    Jose Romero

    Remix TypeScript public recipes

    The function PendingLink() will create a Link element with the given to and children attributes. If isPending is not null, the Link will have a data-pending attribute that will be set to "true" if the link is pending or "null" if the link is active.

    Library: remix


    import { useTransition, useResolvedPath, Link } from "remix";
    function PendingLink({ to, children }: { to: string; children: any }) {
      const transition = useTransition();
      const path = useResolvedPath(to);
      const isPending =
        transition.state === "loading" &&
        transition.location.pathname === path.pathname;
      return (
          data-pending={isPending ? "true" : null}
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.