SplitAtom re-renders from current and previous atom #627
-
Playing around with the code sandbox linked in the documentation I noticed some curiosities. Which I added another task and some console.logs On this screenshot I've simply clicked on the task one, two and three, but as you see, one and two is re-rendered twice. Is this expected behaviour, a bug or am I simply missing something here? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
It's expected behavior. It's best effort to be compatible with concurrent rendering. useEffect(() => {
console.log(todo.task, "committed");
}) |
Beta Was this translation helpful? Give feedback.
It's expected behavior. It's best effort to be compatible with concurrent rendering.
If you check the log in useEffect, it should be more intuitive. So, it's double-render-one-commit behavior.