Packages

create-react-app

5.1.0 · 15 Feb 2025MIT34.4k / weekRepositoryHomepagenpmAtom feed

Your version

3.3.0

5 Dec 2019Where it was published

3.4.1 is the newest release of 3.x.

In short

18 new10 fixed21 changed21 internal

Release note

v3.3.0 is a minor release that adds new features, including custom templates and support for the new optional chaining and nullish coalescing operators.

Custom Templates

You can now create a new app using custom templates.

We've published our existing templates as cra-template and cra-template-typescript, but we expect to see many great templates from the community over the coming weeks.

The below command shows how you can create a new app with cra-template-typescript.

npx create-react-app my-app --template typescript

Note that you can omit the prefix cra-template- when specifying which template you would like. For TypeScript users, we're deprecating --typescript in favour of --template typescript.

If you don't set a template, we'll create your new app with cra-template - which is just a new name for our base template.

Optional Chaining and Nullish Coalescing Operators

We now support the optional chaining and nullish coalescing operators!

// Optional chaining
a?.(); // undefined if `a` is null/undefined
b?.c; // undefined if `b` is null/undefined

// Nullish coalescing
undefined ?? 'some other default'; // result: 'some other default'
null ?? 'some other default'; // result: 'some other default'
'' ?? 'some other default'; // result: ''
0 ?? 300; // result: 0
false ?? true; // result: false

If you're using TypeScript, you will need to upgrade your typescript dependency to 3.7.0 or later if you wish to use the new operators.

If you're using Visual Studio Code 1.40 (the latest as of this release) or earlier, you will need to configure your editor if you want it to understand the new operators.

If you're using TypeScript in your project and have already upgrade its version as described above, then you can configure VS Code to Use Workspace Version of TypeScript. If your project isn't using TypeScript, you can use the JavaScript and TypeScript Nightly extension until VS Code releases a newer version including TypeScript 3.7.0 or newer.

Numeric Separators

We've added support for numeric separators to improve readability of numeric literals.

1000000000; // Is this a billion? a hundred millions? Ten millions?
101475938.38; // what scale is this? what power of 10?

1_000_000_000; // Ah, so a billion
101_475_938.38; // And this is hundreds of millions

no-unexpected-multiline

We've removed this rule as it is not compatible with Prettier. If you rely on this rule you can re-enable it by extending our ESLint config and adding the following:

{
  "extends": "react-app",
  "rules": {
    "no-unexpected-multiline": "warn"
  }
}

:rocket: New Feature

  • babel-preset-react-app: Add optional chaining and nullish coalescing operators support (@renatoagds)

  • babel-preset-react-app, react-dev-utils: Add numeric separator support (@tharun208)

  • cra-template-typescript, cra-template, create-react-app, react-scripts: Add template support (@mrmckeb)

:boom: Breaking Change

  • Breaking

    create-react-app, react-dev-utils, react-scripts

    • Bump webpack-dev-server (@ianschmitz)

      NOTE: This is only a breaking change if you're using react-dev-utils outside of Create React App.

:bug: Bug Fix

  • eslint-config-react-app: Remove no-unexpected-multiline rule (@iansu)

  • create-react-app: Support templates in scoped packages (@klasbj)

  • create-react-app: added check for typescript template and unsupported node version (@awaseem)

  • react-scripts: Mark TypeScript as an optional peer dependency for react-scripts (@dstaley)

  • react-scripts: Fix absolute paths issue in Jest (@rovansteen)

  • react-scripts: Fixed process type in TypeScript template. (@fuszenecker)

  • react-dev-utils: Edit InterpolateHtmlPlugin hook (#6448) (@GuiHash)

:nail_care: Enhancement

  • cra-template-typescript, cra-template: Prefix apple-touch-icon links with PUBLIC_URL (@benblank)

  • cra-template-typescript, cra-template: Add @testing-library to the default templates (@kentcdodds)

  • react-scripts: Add scripts support to templates (@mrmckeb)

  • react-scripts: Add restoreMocks to supported jest config keys (@ianschmitz)

  • react-scripts: Add additional information for postcss errors (#6282) (@buildbreakdo)

  • react-scripts: Add Service-Worker header to checkValidServiceWorker (@darthmaim)

  • react-scripts: feat: add additional Jest keys to whitelist (@mrmckeb)

  • react-scripts: Fix node_modules sourcemap config (which will fix VSCode debugging of CRA apps) (@justingrant)

  • cra-template: No spinning React logo if prefers-reduced-motion (@donavon)

  • create-react-app, react-error-overlay: Dark scheme overlay (@Fabianopb)

  • babel-preset-react-app: Add babel runtime version to transform-runtime plugin to reduce bundle size (@topaxi)

:memo: Documentation

  • Other

  • react-dev-utils, react-scripts: Add placeholders where old template READMEs used to be (@iansu)

  • react-dev-utils: chore: Fix broken link for CRA deployment (@haruelrovix)

  • react-scripts: Add Alex to lint documentation (@iansu)

  • react-scripts: Fix notations of loopback addresses (@wataash)

:house: Internal

  • react-scripts: Add TypeScript peer dependency to react-scripts (@iansu)

  • react-scripts: Add tests for optional chaining and null coalescing (@ianschmitz)

  • react-scripts: Revert logo in templates (@iansu)

  • Other

    • Re-enable GitHub Actions (@iansu)

    • Temporarily disable GitHub Actions (@iansu)

    • Add yarn.lock to .gitignore (@lukyth)

    • Remove alex precommit check (@iansu)

    • Add a GitHub Action that runs the build script (@iansu)

  • eslint-config-react-app: Use @typescript-eslint/no-unused-expressions to support optional chaining (@maxdavidson)

  • create-react-app: refactor: remove double coerce (@mrmckeb)

  • create-react-app: Pass through fully specified template name (@iansu)

  • cra-template-typescript: Make base and TypeScript templates consistent (@suprj)

  • create-react-app, react-dev-utils, react-scripts: Temporarily disable Windows in CI (@ianschmitz)

:hammer: Underlying Tools

  • babel-preset-react-app, cra-template-typescript, cra-template, create-react-app, react-dev-utils, react-error-overlay, react-scripts: Bump dependencies (@ianschmitz)

  • create-react-app, react-dev-utils, react-scripts: Bump webpack-dev-server (@ianschmitz)

  • create-react-app, react-dev-utils, react-scripts: Bump styling related loaders (@andriijas)

  • react-app-polyfill: Unpin dependencies in react-app-polyfill (@ianschmitz)

  • babel-preset-react-app, react-app-polyfill, react-dev-utils, react-scripts: Bump dependencies (@ianschmitz)

  • react-scripts: Upgrade jest-watch-typeahead (@Andarist)

  • react-scripts: Fix eslint complaints in build.js (@andriijas)

  • react-scripts: feat: upgrade terser & enable parallel minification in wsl (@endiliey)

  • react-scripts: Move unused eslint webpack import into @remove-on-eject block (@mrseanbaines)

  • babel-preset-react-app, cra-template-typescript, create-react-app, react-app-polyfill, react-dev-utils, react-error-overlay, react-scripts: Fix CI (@ianschmitz)

  • react-dev-utils: Update open (@andriijas)

  • babel-plugin-named-asset-import, babel-preset-react-app, react-error-overlay, react-scripts: Upgrade outdated packages (@andriijas)

  • react-error-overlay, react-scripts: Bump react (@andriijas)

Migrating from 3.2.0 to 3.3.0

Inside any created project that has not been ejected, run:

npm install --save --save-exact react-scripts@3.3.0

or

yarn add --exact react-scripts@3.3.0

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.