Remix Utils - v9.0.0
    Preparing search index...
    • Create a new Response with a redirect set to the URL the user was before. It uses the Referer header to detect the previous URL. It asks for a fallback URL in case the Referer couldn't be found, this fallback should be a URL you may be ok the user to land to after an action even if it's not the same.

      Parameters

      • request: Request
      • __namedParameters: ResponseInit & { fallback: string }

      Returns DataWithResponseInit<never>

      export async function action({ request }: Route.ActionArgs) {
      await doSomething(request);
      // If the user was on `/search?query=something` we redirect to that URL
      // but if we couldn't we redirect to `/search`, which is an good enough
      // fallback
      return redirectBack(request, { fallback: "/search" });
      }