This repository has been archived by the owner on Feb 14, 2023. It is now read-only.
Dispatch re-renders components even when state is unchanged. #215
Labels
bug
Something isn't working as expected.
I am using reactn on 2.2.7 and react on 16.13.1
The react docs on
useReducer
imply that the state property being dispatched to will not actually be updated if the next value is identical to the previous one: https://reactjs.org/docs/hooks-reference.html#bailing-out-of-a-dispatch (it talks about components not rerendering but presumably the ultimate cause of that is that the state has not been updated)It looks to me as though this same convention is not being observed in the reactn
useDispatch
with a global inline property reducer (https://github.com/CharlesStover/reactn#usedispatchfunction-keyof-state) which I would consider an equivalent use case.I'm curious to know whether this is known and deliberate, unknown and of interest, or just plain wrongly observed of me.
I'm happy to provide more detailed explanation and examples if it would be helpful.
Thank you for the reactn project. It's been a joy to work with, not least because of the excellent documentation and articles. It's very intuitive and follows from reacts hooks nicely which is obviously a goal of the project. Congratulations.
The text was updated successfully, but these errors were encountered: