Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save TowhidKashem/ab2bf90e9111fcccf9aaf565143caad3 to your computer and use it in GitHub Desktop.

Select an option

Save TowhidKashem/ab2bf90e9111fcccf9aaf565143caad3 to your computer and use it in GitHub Desktop.
Sonner native patch to make it as wide as the inner contents
# Makes toasts as wide as their inner content, otherwise they span the full width of the screen.
diff --git a/node_modules/sonner-native/.bun-tag-478b337b96d2cca6 b/node_modules/sonner-native/.bun-tag-478b337b96d2cca6
new file mode 100644
index 0000000..e69de29
diff --git a/node_modules/sonner-native/lib/module/toast.js b/node_modules/sonner-native/lib/module/toast.js
index 2947986..ff3b311 100644
--- a/node_modules/sonner-native/lib/module/toast.js
+++ b/node_modules/sonner-native/lib/module/toast.js
@@ -307,7 +307,7 @@ export const Toast = /*#__PURE__*/React.forwardRef(({
richColors: richColors
}), /*#__PURE__*/_jsxs(View, {
style: {
- flex: 1
+ flexShrink: 1
},
children: [/*#__PURE__*/_jsx(Text, {
style: [defaultStyles.title, titleStyleCtx, styles?.title],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment