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

Components crashing after upgrading to React 16.5 #219

Open
kamthamc opened this issue Sep 27, 2018 · 4 comments
Open

Components crashing after upgrading to React 16.5 #219

kamthamc opened this issue Sep 27, 2018 · 4 comments

Comments

@kamthamc
Copy link

Components crashing with the error https://reactjs.org/docs/error-decoder.html/?invariant=185

The crash is happening when trying to set new data from API.

And the stack trace is
image

Versions:
react-list@0.8.10
react: 16.5.1
react-dom: 16.5.1

I don't have an example at the moment but I will try to provide one.

@acusti
Copy link

acusti commented Sep 28, 2018

We are running into the same issue in our app, though unclear as of yet what’s the cause or specific steps to reproduce.

@meta-meta
Copy link

I'm seeing this with React 16.3.0 though haven't isolated the issue yet.

@christiaanwesterbeek
Copy link

christiaanwesterbeek commented Oct 11, 2018

I encountered something similar today, but not quite the same. What I did was 2 things.

  1. Make sure that not my entire component tree crashes by nesting ReactList with ErrorBoundary like so: <ErrorBoundary><ReactList /></ErrorBoundary> . That helped keeping the error bounded and not crash the entire app.
  2. When I would scroll back and forth each and each component is doing an http request, what could happen was that the component that made the request was already unmounted and when the promise resolved calling this.setState would throw: "Warning: Can only update a mounted or mounting component..." To fix that, I made sure that I canceled the promise (promise.cancel()) in componentWillUnmount in the components in the list.

I'm not at all sure if this is causing the components crashing with you, but it may give you some pointers figuring it out. Good luck.

@kamthamc
Copy link
Author

@ christiaanwesterbeek Thank you. I think Te second point you have mentioned might be able to help me.

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

No branches or pull requests

4 participants