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

Suspense causes attach to be called multiple times #2250

Closed
Tracked by #2338
giulioz opened this issue May 3, 2022 · 3 comments · Fixed by #2268
Closed
Tracked by #2338

Suspense causes attach to be called multiple times #2250

giulioz opened this issue May 3, 2022 · 3 comments · Fixed by #2268
Labels
bug Something isn't working

Comments

@giulioz
Copy link
Member

giulioz commented May 3, 2022

When using the attach prop with a function, its attach function gets called multiple times without a detach when a suspended sibiling component resumes. This causes potentially too many objects to be created.

Sandbox: https://codesandbox.io/s/append-bug-xslv50?file=/src/index.tsx

@clementshimizu
Copy link

clementshimizu commented May 6, 2022

I’m seeing a similar bug of objects being duplicated. I have not found what’s specific LT causing it. But I notice the error happens on iOS chrome and safari on first load but not on reload. Also desktop doesn’t have the problem. I’m not using suspense or attach, but it seems related.

@CodyJasonBennett CodyJasonBennett added the bug Something isn't working label May 9, 2022
@CodyJasonBennett
Copy link
Member

@clementshimizu if you can make a reproduction on codesandbox or similar we can get a better comparison. Looking into the above issue for the moment.

@CodyJasonBennett
Copy link
Member

CodyJasonBennett commented Sep 3, 2022

Merged a fix into #2465, this can be expected to be released in the next v9 candidate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
4 participants