Skip to content

Instantly share code, notes, and snippets.

@nilshartmann
Last active October 25, 2020 09:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nilshartmann/d31b7a423b5d221ea5e792263a550430 to your computer and use it in GitHub Desktop.
Save nilshartmann/d31b7a423b5d221ea5e792263a550430 to your computer and use it in GitHub Desktop.
Upgrade to create-react-app v4

Release Notes

Upgrade react-scripts and dependencies:

yarn add --exact react-scripts@4.0.0
yarn add react react-dom
yarn add @types/react @types/react-dom
yarn add typescript
yarn add @testing-library/jest-dom @testing-library/react @testing-library/user-event @types/jest

Modify tsconfig.json

"Fix" resolution of external library

"resolutions": {
    "lib-that-causes-trouble/react": "^17.0.1",
    "lib-that-causes-trouble/react-dom": "^17.0.1"
  }
  • of course "real" fix would be either upgrading the library to React 17 or (even better) if the lib would add React as peerDependency instead of dependency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment