Open zlanich opened 3 years ago
Hey there! I'm reporting a bug that seems to have also appeared in use-immer.
use-immer
When invoking a reducer function, it fires twice initially, but it appears that it does not modify the state twice.
I've reproduced it in CodeSandbox: https://codesandbox.io/s/immer-reducer-duplicate-invokation-iylwj
use-immer Issue: https://github.com/immerjs/use-immer/issues/11
The solution seemed to have something to do with the need to memo a produce()'d reducer, or something along those lines.
produce()
Thanks!
Hey there! I'm reporting a bug that seems to have also appeared in
use-immer
.When invoking a reducer function, it fires twice initially, but it appears that it does not modify the state twice.
I've reproduced it in CodeSandbox: https://codesandbox.io/s/immer-reducer-duplicate-invokation-iylwj
use-immer
Issue: https://github.com/immerjs/use-immer/issues/11The solution seemed to have something to do with the need to memo a
produce()
'd reducer, or something along those lines.Thanks!