v3.0.0
Version 3.0.0 of Medusa UI introduces a breaking change for the toast components. This is due to a change in the underlying toast library from Radix UI to Sonner.
How to Update
Run the following command in your project:
Breaking Changes
useToast Hook
Previously, you created a toast using the useToast
hook, which provides a utility function. In this version, the useToast
hook is removed and, instead, a new toast
utility is exported. The toast
utility has functions that create toasts for different variants, such as warning
and error
.
For example, here's before and after update code to see the difference:
Learn more about the toast
utility in the UI documentation.
Toaster Default Position
The default position has changed from top-right
to bottom-right
. You can change the position of the created toasts by passing the position
prop to the Toaster
component.
For example:
Learn more about the Toaster
's props in the UI documentation.