feat: upgrade React 16 to 18 #1852
Draft
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.
Summary
Upgrade React from 16.14 to 18.3. Depends on #1851 (RTL migration).
Changes (10 files, +267 −231)
Dependencies
react/react-dom: ^16.14.0 → ^18.3.1react-mosaic-component: ^4.1.1 → ^6.1.1@testing-library/react: ^12.1.5 → ^16.1.0@types/react/@types/react-dom: → ^18.3.0@types/reactresolution to prevent duplicate type versionsSource changes
src/renderer/app.tsx:ReactDOM.render()→createRoot().render()src/renderer/components/settings-electron.tsx: Fix controlled checkbox (React 18 behavioral change)src/renderer/components/output.tsx: Null-safethis.context?.mosaicActionssrc/blueprint-react18.d.ts: Type augmentations for Blueprint v3childrenpropTest fixes (React 18 compat)
tests/renderer/app-spec.tsx: WrapcreateRootrender inact()rtl-spec/: AddwaitFor()for MobX observer batching,act()forsetState,blueprintNamespacein mosaic mockVerification
tsc --noEmit: 0 errorsvitest run: 91 files, 806 passedyarn start: builds and launches