-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
Bug 🐞Something isn't workingSomething isn't workingEditor's ChoiceHighlight an issue as something that would be great to be solveHighlight an issue as something that would be great to be solve
Description
The Toast has a canAutoClose prop which works fine the first time, but fails on subsequent uses of the Toast. For example:
- have a button and when you press the button, the
Toastappears - give the
ToastthecanAutoCloseprop, so it closes automatically after a few seconds - after the
Toastcloses, if you press the button again, theToastshould appear again, but it doesn't
Nahum's clever work-around to make it work:
const [key, nextKey] = React.useState(0)
handleSomethingEventInYourApp() {
nextKey(prev => prev + 1)
}
<Toast key={key} canAutoClose />
This should work without a clever work-around. From Nahum: "I think the Toast is missing the part of reseting its internal state after closing so it can be open again"
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Bug 🐞Something isn't workingSomething isn't workingEditor's ChoiceHighlight an issue as something that would be great to be solveHighlight an issue as something that would be great to be solve