Migration
Move from react-hot-toast with minimal mental overhead.
Migration
@ilokesto/toast is designed to feel familiar to react-hot-toast users on the common path.
Import swap
// before
import { Toaster, toast } from 'react-hot-toast';
// after
import { Toaster, toast } from '@ilokesto/toast';Keep the same mount pattern
<Toaster />The important difference is that Toaster is also responsible for creating and registering the runtime.
Facade parity
The familiar facade calls stay close:
toast()toast.success()toast.error()toast.loading()toast.custom()toast.promise()
Practical differences
toast.promise()also accepts() => Promise<T>dismissAll()/removeAll()are not separate methods; calldismiss()/remove()without an iduseToaster()is expected to run under a mountedToastercontexttransport="top-layer"is an extra capability
toastOptions merge order
- global
toastOptions - per-type
toastOptions.success/error/loading/blank/custom - per-toast call options
Suggested migration order
- replace imports
- keep your existing
toast.*calls - mount
<Toaster /> - move your
toastOptions - adjust advanced custom rendering only if needed