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

Fix React 18 compatibility #1104

Merged
merged 2 commits into from Oct 26, 2022
Merged

Conversation

mbrinkl
Copy link
Contributor

@mbrinkl mbrinkl commented Oct 26, 2022

Fixes broken client in react 18 strict mode.

Closes #1068, #1073, #1096

The issue: WrappedBoard unmounts and remounts in strict mode, and the debug panel did not unsubscribe the clients when it was destroyed.

Checklist

  • Use a separate branch in your local repo (not main).
  • Test coverage is 100% (or you have a story for why it's ok).

Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

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

Wow, amazing work tracking that down — thank you @mbrinkl!

I’ve tested this out locally, including wrapping the example app in <StrictMode> as that was reported as causing the problem in #1068 and everything appears to be working as expected. 🥳

@mbrinkl
Copy link
Contributor Author

mbrinkl commented Oct 26, 2022

Whoops, I had strict mode when debugging but then I recreated in a new branch and forgot to include it, thanks for catching that.

@delucis delucis changed the title react 18 compatibility Fix React 18 compatibility Oct 26, 2022
@delucis delucis merged commit 2afffb1 into boardgameio:main Oct 26, 2022
@mbrinkl mbrinkl deleted the react-18-compat branch October 26, 2022 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants