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

useMountedState #378

Closed
obr42 opened this issue Jan 19, 2023 · 0 comments · Fixed by #379
Closed

useMountedState #378

obr42 opened this issue Jan 19, 2023 · 0 comments · Fixed by #379
Assignees
Labels
code smell Not good, but not so bad it's a bug
Milestone

Comments

@obr42
Copy link
Collaborator

obr42 commented Jan 19, 2023

There is a version of useState floating around the internet that checks a "is mounted" ref to essentially by default check if the component is mounted before updating the state object. We should use that it would clean up the test output and probably iron out some hidden issues with not checking for component mount. Is more elegant than making a boolean in each useEffect.

@obr42 obr42 added the code smell Not good, but not so bad it's a bug label Jan 19, 2023
@obr42 obr42 added this to the release-1.0.0 milestone Jan 19, 2023
@obr42 obr42 self-assigned this Jan 19, 2023
obr42 added a commit to obr42/react-ui that referenced this issue Jan 19, 2023
obr42 added a commit to obr42/react-ui that referenced this issue Jan 24, 2023
obr42 added a commit to obr42/react-ui that referenced this issue Jan 25, 2023
obr42 added a commit to obr42/react-ui that referenced this issue Jan 25, 2023
obr42 added a commit to obr42/react-ui that referenced this issue Jan 25, 2023
obr42 added a commit that referenced this issue Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code smell Not good, but not so bad it's a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant