Switch sonner-native patch to target ESM source (#10668)

This commit is contained in:
Samuel Newman
2026-05-31 23:45:28 +03:00
committed by GitHub
parent 3205fcd7b3
commit bac06bdf23
2 changed files with 32 additions and 15 deletions
+29 -12
View File
@@ -1,22 +1,39 @@
diff --git a/lib/commonjs/toast.js b/lib/commonjs/toast.js
index 121816a452339c1088aeba87928ff63a0bdacca5..47e74bce47323201f0bb4e5ed9dc55b373c07b97 100644
--- a/lib/commonjs/toast.js
+++ b/lib/commonjs/toast.js
@@ -264,7 +264,7 @@ const Toast = exports.Toast = /*#__PURE__*/React.forwardRef(({
diff --git a/lib/module/toast.js b/lib/module/toast.js
index be089f3ff23017a6844e2010cedc547729e198aa..c2dd0fa2df93f929c33bf2bcc3e6f921941fa006 100644
--- a/lib/module/toast.js
+++ b/lib/module/toast.js
@@ -1,8 +1,8 @@
"use strict";
import * as React from 'react';
-import { ActivityIndicator, Pressable, Text, View } from 'react-native';
-import Animated, { useAnimatedStyle, useSharedValue, withRepeat, withTiming } from 'react-native-reanimated';
+import { ActivityIndicator, Pressable, Text, View, Platform } from 'react-native';
+import Animated, { useAnimatedStyle, useSharedValue, withRepeat, withTiming, FadeOut } from 'react-native-reanimated';
import { ANIMATION_DURATION, useToastLayoutAnimations } from "./animations.js";
import { toastDefaultValues } from "./constants.js";
import { useToastContext } from "./context.js";
@@ -258,7 +258,10 @@ export const Toast = /*#__PURE__*/React.forwardRef(({
...toastSwipeHandlerProps,
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
children: /*#__PURE__*/_jsx(Animated.View, {
entering: entering,
- exiting: exiting,
+ exiting: _reactNative.Platform.OS === 'android' ? undefined : exiting,
+ exiting: Platform.select({
+ android: undefined,
+ default: exiting
+ }),
children: jsx
})
});
@@ -274,7 +274,7 @@ const Toast = exports.Toast = /*#__PURE__*/React.forwardRef(({
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
@@ -268,7 +271,10 @@ export const Toast = /*#__PURE__*/React.forwardRef(({
children: /*#__PURE__*/_jsx(Animated.View, {
style: [unstyled ? undefined : elevationStyle, defaultStyles.toast, toastStyleCtx, styles?.toast, style, wiggleAnimationStyle],
entering: entering,
- exiting: exiting,
+ exiting: _reactNative.Platform.OS === 'android' ? undefined : exiting,
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
+ exiting: Platform.select({
+ android: undefined,
+ default: exiting
+ }),
children: /*#__PURE__*/_jsxs(View, {
style: [defaultStyles.toastContent, toastContentStyleCtx, styles?.toastContent],
children: [promiseOptions || variant === 'loading' ? 'loading' in icons ? icons.loading : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {}) : icon ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
children: [promiseOptions || variant === 'loading' ? 'loading' in icons ? icons.loading : /*#__PURE__*/_jsx(ActivityIndicator, {}) : icon ? /*#__PURE__*/_jsx(View, {