-
Notifications
You must be signed in to change notification settings - Fork 52
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
refactor: Remove UNSAFE_ react lifecycle hooks #2196
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
maiwald
force-pushed
the
update-bootstrap-remove-UNSAFE
branch
from
October 8, 2024 15:47
3e6eb90
to
ea164cf
Compare
LCOV of commit
|
maiwald
force-pushed
the
update-bootstrap-remove-UNSAFE
branch
4 times, most recently
from
October 9, 2024 08:07
4c18cab
to
381ec23
Compare
maiwald
changed the title
Update bootstrap: remove UNSAFE_ react lifecycle hooks
Remove UNSAFE_ react lifecycle hooks
Oct 9, 2024
LCOV of commit
|
LCOV of commit
|
LCOV of commit
|
maiwald
force-pushed
the
update-bootstrap-remove-UNSAFE
branch
from
October 9, 2024 09:17
381ec23
to
c31bb19
Compare
LCOV of commit
|
maiwald
force-pushed
the
update-bootstrap-remove-UNSAFE
branch
from
October 10, 2024 09:24
c31bb19
to
1aadf55
Compare
LCOV of commit
|
jhmegorei
requested changes
Oct 11, 2024
app/packs/src/apps/mydb/elements/details/researchPlans/ResearchPlanMetadata.js
Outdated
Show resolved
Hide resolved
...packs/src/apps/mydb/elements/details/screens/researchPlansTab/EmbeddedResearchPlanDetails.js
Outdated
Show resolved
Hide resolved
app/packs/src/apps/mydb/elements/details/wellplates/WellplateDetails.js
Outdated
Show resolved
Hide resolved
app/packs/src/apps/mydb/elements/details/wellplates/analysesTab/WellplateDetailsContainers.js
Show resolved
Hide resolved
app/packs/src/apps/mydb/elements/list/ElementsTableSampleEntries.js
Outdated
Show resolved
Hide resolved
app/packs/src/apps/mydb/elements/list/ElementsTableSampleEntries.js
Outdated
Show resolved
Hide resolved
maiwald
force-pushed
the
update-bootstrap-remove-UNSAFE
branch
from
October 14, 2024 09:05
1aadf55
to
34ec744
Compare
maiwald
force-pushed
the
update-bootstrap-remove-UNSAFE
branch
2 times, most recently
from
October 17, 2024 10:24
42a4389
to
7be3838
Compare
jhmegorei
approved these changes
Oct 18, 2024
PiTrem
changed the title
Remove UNSAFE_ react lifecycle hooks
refactor: Remove UNSAFE_ react lifecycle hooks
Oct 29, 2024
We don't need to copy the root prop into state. If we don't, there is no need to update the state.
The component already contains a `componentDidUpdate` method that also calls `this.updateThumbNails`.
The hideOverlay() does not exist and is not passed to the component anymore.
With this change updating array values has been fixed by correctly returning a new state in the `setState` handler. This change also removes researchPlan from state, because changes are only affected by its metadata. We also clean up state management by removing all `ref` for state updates in favour of proper `setState` calls using `handleFieldChange`. Lastly, this also updates the UNSAFE_componentWillReceiveProps life cycle hook to componentDidUpdate.
This patch separates state management from presentational components and gets rid of UNSAFE_componentWillReceiveProps.
We don't ever modify the prop so we don't need to store it in state and thus don't need to keep props and state in sync.
We were never updating the reaction state so we can simply use the prop value and don't have to worry about keeping state and props in sync.
This removes reaction from state so we don't have to handle keeping props and state in sync. We are however still just mutating the variable instead of creating new instances and passing those to our callbacks and handlers, but that is for another time.
This way we don't have to worry about when we need to calculate the display values and can get rid of the life cycle methods that modified the reaction prop.
maiwald
force-pushed
the
update-bootstrap-remove-UNSAFE
branch
from
October 30, 2024 10:25
7be3838
to
5053ec1
Compare
LCOV of commit
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.