-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crashing when triggering again with the same action object #68
Comments
Hi @MyGuySi, that's very strange! I wonder if it's related to re-using the same config object? Can you try the following: const NOTIFICATIONS = {
get CANCELLED() {
return {
title: "Cancelled",
duration: Snackbar.LENGTH_INDEFINITE,
backgroundColor: "#DA2446",
action: {
title: "View",
onPress: () => null
}
};
},
get COMPLETED() {
return {
title: "Completed",
duration: Snackbar.LENGTH_LONG,
backgroundColor: "#3DC217"
};
},
get REQUEST() {
return {
title: "New Request",
duration: 5000,
backgroundColor: "#5B408E",
action: {
title: "Open",
onPress: () => null
}
};
}
}; Please let me know if this changes anything. Otherwise, if you could link to a working example app I'd like to try it myself. Thanks. |
Hi @cooperka, yep I tried out your suggestion and that does indeed fix it 🤔 |
Thank you for confirming! This bug should certainly be fixed, but luckily it's rare and easily worked around. I'd welcome a PR to address it if you have the time. |
I'm not using react-native-snackbar in any of my projects currently, it was more of a research exercise so I may not be able to submit a PR straight away but if we decide to use it then I'll definitely take a stab at it 👍 |
Description
I've created a lookup with some configs defined for different notifications and one button to show each one. It works fine until I tap the same button a second time and then I get an error message about the background color (see below).
I should add that this is from a completely fresh React Native project.
Example
The text was updated successfully, but these errors were encountered: