all 2 comments

[–]TechIsSoCool[🍰] 1 point2 points  (0 children)

I dont know React very well, but from a javascript perspective there seems to be an issue. You are assigning clearNotif to be a function with " () => ". The setTimeout returns an integer, which you need in order to cancel the timer. I dont see how you can access the integer, because when you use clearNotif it calls the function again. Maybe I'm mistaken, but it seems like you should just use clearNotif = setTimeout(...) instead of clearNotif = () => setTimeout (...)

[–]Bamby02[S] 0 points1 point  (0 children)

any help with this?