TruSat / trusat-frontend

The React codebase for space-sustainability tool TruSat
https://trusat.org
Apache License 2.0
31 stars 8 forks source link

Moving between pages before API call has finished may cause memory leaks #185

Open johngribbin opened 4 years ago

johngribbin commented 4 years ago

See error in console when you navigate away from the "catalog" view before the data is returned from the API:

Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.
    in CatalogTable (at Catalog.js:46)
    in div (at Catalog.js:17)
    in Catalog (created by Context.Consumer)
    in withRouter(Catalog) (created by Context.Consumer)
johngribbin commented 4 years ago

See discussion on the issue here - https://github.com/facebook/react/issues/15006