Recoil is an experimental state management library for React apps. It provides several capabilities that are difficult to achieve with React alone, while being compatible with the newest features of React.
actually, I try to normalize todoState in a atom(todoIdListState) and atomFamily(todoState) mapping in order to avoid updating all <TodoItem/>, but when I add a state filteredTodoIdListState whitch subscribe atomFamily(todoState), it will cause rerender <TodoList/> when I changing one todoState 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
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