Skip to content

Jotai async atom combined with provider triggers huge amount of re-render, most likely bug. #1776

Answered by dai-shi
devnomic asked this question in General
Discussion options

You must be logged in to vote

Thanks for reporting.

https://codesandbox.io/s/thirsty-lumiere-pymffw?file=/src/App.tsx

I think it is because you create a new jotai store within suspense, and for initial render, react will re-mount the entire tree under suspense. So, this behavior is somewhat reproducible with useState, I suppose.

Didn't look into very closely, so I might be missing something.

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@dai-shi
Comment options

@devnomic
Comment options

@dai-shi
Comment options

@devnomic
Comment options

@dai-shi
Comment options

Answer selected by devnomic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants