Closed DevAlien closed 7 years ago
@DevAlien yes I agree with you I'm thinking of rewriting the component but I am putting it on hold till react fiber is launched with its awesomeness. I'll resume my efforts to improvise the component with a major version and api update (possibly the nougat update as well)
Ok, I've PRd some fixes, if that could be released would be great. if not I'd have to release a fork myself.
I tried this library and at first I could not see the notifications. Looking at the code I found out that you are using a global (scoped) variable to keep track of the notifications called
notifications
The problem is that when you modify that, the component will NOT rerender automatically. Normally this is done using setState and then you would read directly from the state. In this case I think you have to force the update somehow.
In your demo it works just because you are incrementing a counter after you ccreated a new notification.
This will update the component and as well all its subcomponents (in this case the notification component will get updated because it is a child)