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

Double renders #960

Closed
dsathyakumar opened this issue Apr 8, 2021 · 4 comments
Closed

Double renders #960

dsathyakumar opened this issue Apr 8, 2021 · 4 comments
Labels
duplicate This issue or pull request already exists

Comments

@dsathyakumar
Copy link

Hi,

I'm seeing components being rendered twice upon setting the initial state. Is this the intended behavior for Functional Components?

https://codesandbox.io/s/festive-shtern-c1rz3?fontsize=14&hidenavigation=1&theme=dark

@dsathyakumar
Copy link
Author

The console.logs for and get logged twice. Is this behavior intended ?
Can't the initial state be used in the 1st render itself ?

@bryan-hunter
Copy link

there is a fix in place, but it's behind a feature flag - see #314

apparently there's an edge case they are resolving before releasing it fully, but you can patch-package to expose that feature flag for yourself and turn it on.

@drarmstr drarmstr added the duplicate This issue or pull request already exists label Apr 12, 2021
@drarmstr
Copy link
Contributor

Duplicate of #820

@drarmstr drarmstr marked this as a duplicate of #820 Apr 12, 2021
@drarmstr
Copy link
Contributor

The initial render is also addressed with experimental version of React with Concurrent Mode enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants