React hooks not giving updated state

34 views Asked by At

Please access the code at below link : https://codesandbox.io/s/notification-co637

Now in file : Notificaitons.js. : #1 :My comp. is rendered twice, Why? #2 : When i click on button,i am publishing the event but my localState is always having initial value. My array size is always one.

What i am doing wrong here?

I wanted to do this using hooks.I am able to do it in class based comp.

0

There are 0 answers