atlassian / react-sweet-state

Shared state management solution for React
https://atlassian.github.io/react-sweet-state/
MIT License
871 stars 55 forks source link

Protect agains re-render loops if actions set state equal #100

Closed albertogasparin closed 4 years ago

albertogasparin commented 4 years ago

It might happen that a simple action calls setState generating the same shallow equal store state again. We want to avoid unnecessary re-renders (and potentially loops) for this scenario, so we always shallow check before re-rendering