zooniverse / front-end-monorepo

A rebuild of the front-end for zooniverse.org
https://www.zooniverse.org
Apache License 2.0
104 stars 29 forks source link

Classifier: Single Image Viewer should "reset Subject" when component unmounts? #2251

Open shaunanoordin opened 3 years ago

shaunanoordin commented 3 years ago

Lifecycle Improvement

Packages: lib-classifier, app-project (see note-1) Component: Subject Viewer -> Single Image Viewer Follows #2221 (initial issue) and #2241 (initial solution)

Context:

While we have a basic solution to the pertinent problem, we can still improve the component lifecycle. One idea is to perform a proper cleanup after the component unmounts.

Recommended Enhancement:

(note 1) the actual code changes need to be made in lib-classifier, but the behaviour can only be tested on app-project/

Status

Recommended enhancement. Low urgency since it's not breaking anything at the moment, that we know if, but a clean lifecycle is the correct way to do things.

goplayoutside3 commented 10 months ago

I'm unsure if this is still needed. React no longer uses componentWillUnmount and SingleImageViewer has been refactored to a functional component since this Issue was opened. @shaunanoordin when you have time, will you double check if this Issue is still a recommended refactor?