import { useTransition } from "remix";
      
      function filename() {
        const transition = useTransition();
        const text =
          transition.state === "submitting"
            ? "Saving..."
            : transition.state === "loading"
            ? "Saved!"
            : "Go";
        return <button type="submit">{text}</button>;
      }
      Typescript language logo
      your recipe card header background

      Button with transition

      Remix TypeScript public recipes

      This code creates a button that will submit the form when it is clicked. The code first uses the useTransition() function to determine the transition between the 'submitting' and 'loading' states. The SubmitButton() function then sets the text of the button to either "Saving..." or "Saved!", depending on the state of the transition.

      Library: remix

      Shortcut: remix.button.transition

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.