Toast onClose not firing
See original GitHub issueIssue Description
It looks like the Toast
onClose
property isn’t firing for me in any case. This is happening both on Android an iOS.
Example: https://snack.expo.io/3r4vae3LY
node, npm, react-native, react and native-base version, expo version if used, xcode version
“react-native”: “0.63.0”, “native-base”: “^2.13.13”, “react”: “16.13.1”,
Expected behaviour
The onClose
function actually gets called
Actual behaviour
onClose
is never called.
Steps to reproduce
Just try to add an onClose
to a Toast and it should not work.
const Test = () => (
<Button
title="Show Toast"
onPress={() => {
Toast.show({
text: "This is the toast",
duration: 5000,
buttonText: "click me",
onClose: (reason) => {
// this is never fired in any case, whether clicking on buttonText or letting it self-dismiss
console.warn(reason);
throw new Error('should error');
},
})
}}
/>
)
Is the bug present in both iOS and Android or in any one of them?
Both
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:14 (1 by maintainers)
Top Results From Across the Web
How to trigger React Toastify onClose only after toast closes?
The following code renders a toast: import { ToastContainer, toast } from "react-toastify"; import "react-toastify/dist/ReactToastify.css"; ...
Read more >Troubleshooting Checks that Will Not Close - Toast Central
If it is past the prep time for the order, the check will fire immediately. If it has a payment on it, the...
Read more >Define callback | React-Toastify - GitHub Pages
Define callback. You can define two callbacks. Their names are self-explanatory: onOpen; onClose.
Read more >Toasts - Bootstrap
This event is fired when the toast has finished being hidden from the user. Copy. $('#myToast').on( ...
Read more >react-toastify - npm
Ensure not to render any toast that has containerId . ... onOpen is called inside componentDidMount; onClose is called inside ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @Michael-M-Judd , we just published a new version 2.13.14 with the latest dependency fixes. Can you please upgrade and let us know if the issue still persists?
any solution for this one? I found out that the latest version is affecting the react-navigation Tabs. I’m using the latest version