schiehll / react-alert

alerts for React
MIT License
607 stars 99 forks source link

Added clearing of setTimeout ID so that it can be cleared when the component is unmounted #80

Closed rj-david closed 6 years ago

rj-david commented 6 years ago

This avoids this bug: https://github.com/schiehll/react-alert/issues/79

With this fix, the setTimeout() function is cleared whenever the component is unmounted. This also supports multiple alerts.

Please disregard the changes in .gitignore. The fix only involved src/Provider.js

schiehll commented 6 years ago

Hey, @rj-david! Thank you for the PR!

I will review your changes so we can merge it.