Reputation: 387
I want to reuse a Counter component with his own internal store.
The problem is when I change the state, it´s changed in all the Counter instances. I´m returning state as state = () => ({})
but, It´s shared in all instances...
How can setup this to use his own state? Demo: https://codesandbox.io/s/infallible-black-k9e8f
Upvotes: 0
Views: 280