Upgrade to React 18 #1445
Labels
datagateway-common
datagateway-dataview
Issues corresponding to the dataview component. This component supersedes datagateway-table
datagateway-download
Issues relating to the download plugin
datagateway-search
Issues relating to the search plugin
dependencies
Pull requests that update a dependency file
enhancement
New feature or request
Description:
Should be tackled in conjunction with ral-facilities/scigateway#1205.
At present, we are running React v17.0.2. v18 has been out for some time now and we should upgrade to the latest stable version, which currently sits at v18.2.0.
React 18 brings a variety of improvements and changes. It's worth having a read of the official React 18 blog post to learn of the additions it has brought (some of these you may find useful going forward!).
Refer to the official React 18 migration guide while tackling this issue. It's important we eliminate any deprecated code that could interfere with the upgrade. For example:
And we don't want that, do we?
The only obstacle standing in React 18's way at the time this issue was created is the continuing use of Enzyme for tests (which aren't officially supported in React 17 and break entirely in React 18). Fortunately, work is underway to migrate all remaining Enzyme tests to React Testing Library. Once that work is completed, we can begin the upgrade to React 18.
Finally, all that's left to make sure of is that both SciGateway and DataGateway are upgraded to React 18 at the same time. This ensures all runs smoothly between the parent app and its plugins.
Acceptance criteria:
The text was updated successfully, but these errors were encountered: