This repository has been archived by the owner on Jan 1, 2025. It is now read-only.
can Recoil stop update React Component update when atom value still same after update? #493
Labels
duplicate
This issue or pull request already exists
Hey guys! I want to stop rerender Component when atom/selector get the same value after updater. What should I do?
Here's the playground: https://codesandbox.io/s/stoic-resonance-vecxs?file=/src/App.js:758-811
actually, I try to normalize
todoState
in aatom(todoIdListState)
andatomFamily(todoState)
mapping in order to avoid updating all<TodoItem/>
, but when I add a statefilteredTodoIdListState
whitch subscribeatomFamily(todoState)
, it will cause rerender<TodoList/>
when I changing onetodoState atom
. How can I stop this rerender? Is there a way like react useState's internal compare check?Here's the playground with normalize todo: https://codesandbox.io/s/condescending-sinoussi-d3ck0?file=/src/App.js:1853-1861
The text was updated successfully, but these errors were encountered: