Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid rerenders if atom value doesn't change #28

Open
SukkaW opened this issue May 27, 2022 · 1 comment
Open

Avoid rerenders if atom value doesn't change #28

SukkaW opened this issue May 27, 2022 · 1 comment

Comments

@SukkaW
Copy link
Contributor

SukkaW commented May 27, 2022

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?

@dai-shi
Copy link
Owner

dai-shi commented May 27, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants