codesandbox-client icon indicating copy to clipboard operation
codesandbox-client copied to clipboard

When mounting and with StrictMode disabled, Component with useState hook sometimes once (as expected), sometimes renders twice (not normal)

Open hymced opened this issue 1 year ago • 2 comments

🐛 bug report

Preflight Checklist

  • [x] I have read the Contributing Guidelines for this project.
  • [x] I agree to follow the Code of Conduct that this project adheres to.
  • [x] I have searched the issue tracker for an issue that matches the one I want to file, without success.

Description of the problem

When mounting and with StrictMode disabled, Component with useState hook sometimes once (as expected), sometimes renders twice (not normal), as seen in the console

How has this issue affected you? What are you trying to accomplish?

Having the exact same behavior as in other IDEs, should only render once.

To Reproduce

Consider this example and refresh the page after its fully loaded to see the behavior:

Link to sandbox: link

Your Environment

Software Name/Version
Сodesandbox 0.0.158
Browser Version 120.0.6099.200 (Official Build) (64-bit)
Operating System Windows 10

hymced avatar Jan 11 '24 15:01 hymced

Hello @hymced ,

I'm afraid I'm not seeing any issues with that Sandbox.

Please could you contact us via [email protected] with some screenshots and more detailed reproduction steps?

JamesACS avatar Jan 11 '24 16:01 JamesACS

@JamesACS You should have a link with a screen record I made in your emails. But really the steps are just as I described them.

hymced avatar Jan 11 '24 16:01 hymced