dai-shi / use-atom

Yet another implementation for Jotai atoms without side effects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Avoid rerenders if atom value doesn't change

SukkaW opened this issue · comments

commented

The issue is similar to the one in the jotai: pmndrs/jotai#1158 (comment)

image

Is it possible to apply a fix similar to pmndrs/jotai#1159, to prevent atoms with the same primitive value from unnecessary committing?

No, it's not possible because we always run update function in render phase. And, thus, side effects are not allowed in the update function.