Releases: forge-42/remix-toast
v4.0.0
What's Changed
- Upgrade zod to v4 by @MonsterDeveloper in #44
- fix(docs): ComponentArgs -> ComponentProps by @kesoji in #49
New Contributors
Full Changelog: v3.4.0...v4.0.0
v3.4.0
What's Changed
- Allow zero duration by @MonsterDeveloper in #43
- Add
replaceWithFlash/replaceWithToastby @kenn in #51
New Contributors
- @MonsterDeveloper made their first contribution in #43
Full Changelog: v3.3.0...v3.4.0
v3.3.0
v3.2.0
What's Changed
- rr v7.8.0 by @stevan-borus in #47
New Contributors
- @stevan-borus made their first contribution in #47
Full Changelog: v3.1.0...v3.2.0
v3.1.0
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
- Passthrough toasts by @AlemTuzlak in #40
Full Changelog: v3.0.0...v3.1.0
v3.0.0 - Middleware support
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
- Update package.json by @petrpacas in #32
- Update git organizations to forge-42 by @beeman in #39
New Contributors
- @petrpacas made their first contribution in #32
- @beeman made their first contribution in #39
Full Changelog: v2.0.0...v3.0.0
v2.0.0 - React router v7
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
What's Changed
- feat: add optional duration to toast messages by @anthonyhagi in #28
New Contributors
- @anthonyhagi made their first contribution in #28
Full Changelog: v1.2.1...v1.2.2
v1.2.1
What's Changed
- Update README.md by @kianweelee in #15
- fix: flash message not being cleared when using custom session by @michelmattos in #25
New Contributors
- @kianweelee made their first contribution in #15
- @michelmattos made their first contribution in #25
Full Changelog: v1.2.0...v1.2.1
v1.2.0
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
- 7 add description field to toastmessage by @AlemTuzlak in #12
New Contributors
- @AlemTuzlak made their first contribution in #12
Full Changelog: v1.1.0...v1.2.0