fix(CRATemplate): Fix installation error with React 18.2.0 #3323
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.
Related issue
Resolves #3322
Overview
This gets the CRA template and smoke test working again.
Reason
The CRA template and smoke test starting failing since the release of React 18.2.0
Work carried out
Developer notes
The CRA template and smoke test starting failing again since the release of React 18.2.0, because the overrides are for
react@^18.1.0
while the main React dependency injected by CRA is nowreact@^18.2.0
.There is a proper way to avoid this problem using references:
However, this is currently not working and results in this error:
At first I thought this was due to how CRA installs packages, but that doesn't actually seem to be the case; it may be due to npm/cli#4395
For now the only solution seems to be to manually keep the overrides up-to-date, unfortunately (until either
$react
is working or all peer dependency ranges in our tree are good).