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

Add example to reproduce race condition bug #90

Merged
merged 2 commits into from
Oct 13, 2019
Merged

Conversation

jpangelle
Copy link
Member

@jpangelle jpangelle commented Oct 13, 2019

This is just to add an example to reproduce the race condition bug documented in issue #84

@jpangelle jpangelle requested a review from zxqx October 13, 2019 18:44
@codecov-io
Copy link

codecov-io commented Oct 13, 2019

Codecov Report

Merging #90 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #90   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           5      5           
  Lines          74     74           
  Branches       14     18    +4     
=====================================
  Hits           74     74

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4f0bbab...4db1b4f. Read the comment docs.


setTimeout(() => {
setDelay(1000);
setThing(colors.FUCHSIA);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setTimeout should always be wrapped by a useEffect - what are you trying to do here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed setTimeout and wrapped the state changes in a useEffect

@jpangelle jpangelle requested a review from zxqx October 13, 2019 18:56
@jpangelle jpangelle merged commit 3c4d896 into master Oct 13, 2019
@jpangelle jpangelle deleted the race-condition-bug branch October 13, 2019 19:03
jpangelle added a commit that referenced this pull request Nov 22, 2019
* add example to reproduce race condition bug

* remove setTimeout
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

Successfully merging this pull request may close these issues.

3 participants