Skip to content

Instantly share code, notes, and snippets.

@ptheofan
Last active February 12, 2025 10:15
Show Gist options
  • Save ptheofan/8bab732909909eb66905fd6448a61883 to your computer and use it in GitHub Desktop.
Save ptheofan/8bab732909909eb66905fd6448a61883 to your computer and use it in GitHub Desktop.
Create React 18 app after React 19 is out.

React 19 came out and npx create app is using it but it's not working as expected as testing library is not up-to-date yet.

Original Post

facebook/react#32016 (comment)

Posted Solution

The workflows that solve version incompatibility issues without --force or --legacy-peer-deps and restrict the versions to current up-to-date ones. Make sure the last command runs without errors (vulnerability warnings don't count)

Javascript

npx -y create-react-app@5 .
npm rm cra-template
npm i react@19 react-dom@19 web-vitals@3
npm i -D @testing-library/jest-dom @testing-library/react @testing-library/user-event jest@29
npx -y rimraf node_modules && npm i

Typescript

npx -y create-react-app@5 . --template=typescript
node -e "require('react-scripts/scripts/utils/verifyTypeScriptSetup')()"
npm rm cra-template-typescript
npm i @types/react@19 @types/react-dom@19 react@19 react-dom@19 web-vitals@3
npm i -D @testing-library/jest-dom @testing-library/react @testing-library/user-event @types/jest@29 @types/node jest@29 typescript@5
npm pkg set overrides.react-scripts.typescript=">=5"
npx -y rimraf node_modules && npm i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment