<ToastNotification /> prop timeout > 0 does not render component on UI.
See original GitHub issueBUG -
- I am on @carbon/ibm-security version 1.41.0 and
- I am facing issue with <ToastNotification /> component.
Description -
- When I pass prop timeout value > 0 (say 12000), it is not rendering the component on UI.
- BUT when I pass prop timeout as 0, then it is rendered as expected on UI.
<ToastNotification
onCloseButtonClick={onToastClose}
className='toast-notification animated slideInUp'
title={error.title}
subtitle={error.subtitle}
kind={error.title.toLowerCase()}
caption=''
timeout={12000}
/>
Expected behavior -
- Notification should be rendered on UI for provided timeout span
Actual behavior -
- Notification is not rendered at all if timeout prop value is > 0
Steps for reproducing - (TRY it in both Chrome and Firefox)
Browsers
- Not browser specific
Optional information
- None
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Toast Notification: timeout prop · Issue #4666 - GitHub
Leveraging the same idea of a toast timeout, I am conditionally rendering the notification. This way the click handler will not be executed....
Read more >How to create a custom toast component with React
Learn how to create a customizable toast component that is capable of displaying multiple notifications using the React hooks useState and ...
Read more >Toast is not rendered (react-toastify component) - Stack Overflow
If I debug it, I see that my toasts are queued, _EventManager2 never gets the _constant.ACTION.MOUNTED event that normally emits the toasts from ......
Read more >Snackbar / Toast Notifications in React Tutorial - YouTube
In this video I will teach you all how to code a snackbar in reactjs.
Read more >Creating Toast API with React Hooks | by Aibol Kussain
Additionally, in order to not mess with z-index, it is better to render components like toasts somewhere up in a DOM tree.
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 FreeTop 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
Top GitHub Comments
@emyarod @SwapnilAhire https://codesandbox.io/s/hopeful-aryabhata-h824j?file=/src/index.js is the reduced test case. It’s not working for “carbon/ibm-security”: “1.40.0” and later. Also found out that this issue is already resolved in https://github.com/carbon-design-system/carbon/issues/8348 and may be available in next version.
the fix was released in
carbon-components-react@7.33.0