Created
December 18, 2019 10:55
-
-
Save tobob/48c2d3a217a0c481294b2053ccc43649 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
useEffect(() => { | |
if (toast.visible) { | |
timeout.current = setTimeout(hide, 1500); | |
return () => { | |
if (timeout.current) { | |
clearTimeout(timeout.current); | |
} | |
}; | |
} | |
}, [hide, toast]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment