Skip to content

Releases: forge-42/remix-toast

v3.1.0

09 Apr 13:43
42bcbd8
Compare
Choose a tag to compare

Self-setting toast notifications

You can now use a setToast utility from middleware to set toasts anywhere and they are automatically added.

Enhanced toast passthrough

Now you can pass in any arbirtrary properties into toasts

What's Changed

Full Changelog: v3.0.0...v3.1.0

v3.0.0 - Middleware support

05 Apr 12:30
Compare
Choose a tag to compare

Middleware mode

In order to be able to show toasts anywhere in the app you need to add the following code to your root.tsx file.

import { getToast, unstable_toastMiddleware } from "remix-toast/middleware";

export const loader = async ({ request }: LoaderFunctionArgs) => {
  // Extracts the toast from the request
  const toast = getToast(context); 
  // pass it to the client side
  return { toast }
}

export default function App({ children }: { children: ReactNode }) {
  const { toast } = useLoaderData<typeof loader>();
  
  useEffect(() => {
   if(toast){
    // Call your toast function here
    alert(toast.message);
   }
  }, [toast])

  return (
    ...
  );
}

// Export the middleware to be used in the app
export const unstable_middleware = [unstable_toastMiddleware()];

This change also should fix any sort of race condition issues that were reported in the past

What's Changed

New Contributors

Full Changelog: v2.0.0...v3.0.0

v2.0.0 - React router v7

23 Nov 12:56
Compare
Choose a tag to compare

React router v7

Remix toast now supports react-router v7, if you're using remix you can stay on v1.2.2 until you migrate and use this package!

Breaking changes

All the json* utilities have been renamed to data* to align better with react-router v7 convention

Full Changelog: v1.2.2...v2.0.0

v1.2.2

19 Sep 08:10
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.2.1...v1.2.2

v1.2.1

31 Jul 08:16
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.2.0...v1.2.1

v1.2.0

18 Feb 13:42
c46f4be
Compare
Choose a tag to compare

Description field

Now you can pass in optional description field to all the utilities alongside with the message by passing in an object instead of a string as the second parameter, still works with a string as well

Session configuration

Custom utilities

Now you can create a custom session storage and pass it into createToastUtilsWithCustomSession to create all the utilities used by remix-toast with your custom session. Refer to the README for details.

Global session configuration

Thanks to Raphael there is a new setToastCookieOptions function that allows you to configure your toast session values globally

What's Changed

New Contributors

Full Changelog: v1.1.0...v1.2.0

v1.1.0

18 Nov 10:53
Compare
Choose a tag to compare

jsonWith utilities added

If you don't want to redirect the user but return some info to the current page with the toast data you can do so with the following utilities:

  • jsonWithSuccess
  • jsonWithError
  • jsonWithInfo
  • jsonWithWarning

Thanks to @Erij-Maherzia-BEN-BRAHIM For working on this feature!

What's Changed

New Contributors

Full Changelog: v1.0.2...v1.1.0

v1.0.2

06 Oct 12:59
Compare
Choose a tag to compare

Initial release of Remix Toast!