Install using bunx shadcn@latest add @remix-utils/redirect-back.
This function is a wrapper of the redirect helper from Remix. Unlike Remix's version, this one receives the whole request object as the first value and an object with the response init and a fallback URL.
The response created with this function will have the Location header pointing to the Referer header from the request, or if not available, the fallback URL provided in the second argument.
Install using
bunx shadcn@latest add @remix-utils/redirect-back.This function is a wrapper of the
redirecthelper from Remix. Unlike Remix's version, this one receives the whole request object as the first value and an object with the response init and a fallback URL.The response created with this function will have the
Locationheader pointing to theRefererheader from the request, or if not available, the fallback URL provided in the second argument.This helper is most useful when used in a generic action to send the user to the same URL it was before.
Author
Sergio XalambrÃ