-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
Issues with React 18 StrictMode #106
Comments
This is a major blocker for my team as well |
react-cytoscapejs/src/component.js Line 61 in 3808c36
This looks like it could be the problem. |
yes, I'm also facing a similar issue with getting the cy element back from |
my workaround is currently putting all of my |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
React 18 brings some infamous changes to the way StrictMode works during development (see https://coderpad.io/blog/development/why-react-18-broke-your-app/).
This also seems to cause some issues with this library. I encountered the first error in a piece of code that uses
useEffect
to re-run the layout whenever the elements change. I have created an SSCCE here:https://codesandbox.io/s/cytoscape-react18-strict-mode-ysrugk
This code worked with React 17. Now, you have to remove the
<StrictMode>
inindex.js
to make it work again. This is only an issue during development. If you build a production version of the app, it works normally.I also encountered the following error after swallowing this one with a try-catch.
In my app, this is only triggered when opening the graph in a modal. I was not able to reproduce this in an SSCCE but maybe the stack trace helps.
The text was updated successfully, but these errors were encountered: