Repository navigation
v1.0.0
The toast API is untouched. magicToast.alert, magicToast.success, magicToast.show, Toast.Container and Toast.Message all take the same arguments and behave the same as on 0.4.0. Upgrading is a version bump plus the peer moves below.
The break is react-native-magic-modal going 4 -> 7 underneath.
Requirements
| Package | Minimum |
|---|---|
| react | 18 |
| react-native | 0.81 |
| react-native-reanimated | 4 |
| react-native-gesture-handler | 2.20 |
| react-native-worklets | 0.5 |
| react-native-safe-area-context | 5 |
npx expo install react-native-magic-toast react-native-magic-modal react-native-safe-area-context react-native-reanimated react-native-gesture-handler react-native-workletsIf react-native-magic-modal is in your own package.json, move it to ^7.0.0 in the same commit. Two majors resolving side by side gives you two copies of the module. The <MagicModalPortal /> you render then isn't the one this library pushes toasts into, and toasts stop appearing.
New architecture
Reanimated 4 dropped the legacy architecture and the Paper renderer with it. RN 0.82 took the newArchEnabled toggle out entirely, so 0.82 and later are already on it. On 0.81 with the toggle still off, flipping it is the work in this upgrade.
Reanimated 4 also needs its Babel plugin. babel-preset-expo adds it for you. Outside Expo, put react-native-worklets/plugin last in the plugin list in babel.config.js.
Return values
magicToast.show(...) returns magic-modal's return value directly, and its promise follows v7's shape. v4 resolved the bare value passed to hide(). v7 resolves { reason }, or { reason: MagicModalHideReason.INTENTIONAL_HIDE, data } when the modal was closed through hide(). If you import the enum from magic-modal directly, it's MagicModalHideReason now, not MagicModalHideTypes, and the members lost their -ED suffix (BACKDROP_PRESS, SWIPE_COMPLETE, BACK_BUTTON_PRESS).
Older apps
react-native-magic-toast@0.4.x still tracks magic-modal v4 if your app can't move to RN 0.81 yet.
Verified
Library and example app rebuilt on Expo SDK 55 (RN 0.83.6, React 19.2, Reanimated 4.3.1, worklets 0.8.3):
yarn lint clean
yarn typescript clean
yarn prepare bob build, clean
yarn test 2 passed, rendering through a real MagicModalPortal on Reanimated 4
example/
tsc --noEmit clean
expo export --platform ios bundled
expo export --platform android bundled
expo export --platform web bundled
No simulator or device runs.