question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

autoClose doesn't work with react 0.14.*

See original GitHub issue

Hi,

I’m facing an issue with autoClose. I follow your example, everything works but the toast will never close until triggered manually. I also try your custom animation, The enter event fired, but the exit didn’t.

Here is my code snippet:

– Toast Container settings:

<ToastContainer
    position="top-right"
    type="error"
    autoClose={4000}
/>

– I create a toast by:

toast("Hello", { autoClose: 4000 });

What did I do wrong here?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:21 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
Jayphencommented, Aug 6, 2018

In my case, autoClose was not working because I had not imported all of the CSS files. If you are manually copying the CSS, make sure to include the ProgressBar styles, even if you aren’t actually displaying the progress bar. The component relies on the ProgressBar styling to know when to close the toast (when the ProgressBar animation ends)

1reaction
fkhadracommented, May 21, 2018

@JustFly1984 could you reproduce the issue on codesandbox, so I can help you?

Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Autoclose='outside' doesn't work with multiple menu in react ...
I suspect it's because autoClose only works on the current selected menu, in the example below it works with the main menu and...
Read more >
React v0.14 – React Blog
We're happy to announce the release of React 0.14 today! This release has a few major changes, primarily designed to simplify the code...
Read more >
react-datepicker - npm
Start using react-datepicker in your project by running `npm i ... newer won't work (due to react-onclickoutside dependencies); React 0.14 or newer: All ......
Read more >
Create a Dropdown in React that Closes When the Body is ...
Now we have a problem. If the user clicks outside of the dropdown it will stay open. In order to close the menu...
Read more >
react-dd-menu-customized - npm package | Snyk
Learn more about react-dd-menu-customized: package health score, ... Open Issues: 13 ... animate - boolean if the menu should animate on open and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found