What’s new in Create React App 2.0 ?
Last Updated :
06 Jan, 2021
Those who don’t know create-react-app is the CLI or the command-line-interface tool that’s used to generate React applications and just makes things much easier than opposed to setting your own web pack configuration.
Package Update :
- Babel 7
- Webpack 4
- Jest 23
Babel: Browser support for modern features of JavaScript has gotten better recently but it’s never going to be perfect. We can patch in polyfills or use a little shell script to rewrite our code but those are prone to breaking leading to dead code. Babel is a solution to this problem by taking modern JavaScript and compiling it down to a form that could be understood in different environments. Babel is built on a plugin system that parses our modern JavaScript into an abstract syntax tree or AST and rewrites it into a version that can be interpreted by our browser. To set this up install the babel CLI package and save it as a dev dependency.
npm install --save-dev babel-cli
In other words, it is used to compile newer es6 plus features of JavaScript to be used in all browsers. Version 7 of Babel is faster than previous versions as it has some new features that are that have been added.
Webpack: It is a module builder i.e., webpack is a tool we use during the development of our code and is used during runtime of our assets. Web pack not only just builds your code but also manages your code. It allows us to create awesome web applications managing all our style and JavaScript files mainly but not limited to that.


Webpack is used for bundling.
Jest: Jest is used for testing, it includes new features like interactive snapshot mode and custom matches. Jest works with projects using: Babel, TypeScript, Node, React, Angular, Vue, and more!
- Version 1 of create-react-app had sass integration but there was some additional configuration that needed to be done. With version 2 we can simply install “node-sass” and we can rename our .CSS files to.SCSS. So it makes working with sass easier.
- CSS’s modules allow us to use the same CSS classes across different files without having to worry about conflicts or issues. CSS modules work right out of the box with create react app so you can just import the module using the syntax as shown, [Name].module.scss or [Name].module.css.
- So in addition to sass integration and CSS modules we also have smaller CSS bundles, we can target modern browsers with our package.json file in the browser list specification. So we can adjust our styles to only target either the WebKit prefix or the MS prefix whenever necessary.
package.json:

{
"name": "my-project",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-scripts": "3.4.3"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
- Post CSS has also been added to create a react app too.
- So if you have used version 2, the first thing you probably noticed was the landing page change which is now more simplistic and cleaner look or cleaner page as shown below :

Version 1

Version 2
- There are also been changes with how service workers are implemented version 2 now uses Google’s workbox which is a set of libraries for caching offline assets and working with service workers in a more elegant way than sw-precache and it will make it easier for us to create progressive web applications using the React library.
- There’s now added support for configuring our own proxy with express and a full-stack app, so we can use like the HTTP proxy middleware module and then create a file on your client in your React application right inside the source folder called setupProxy.js rather than defining a proxy object as we would before.
- We can now use packages written for the latest Node versions.
- We can now import an SVG as a React Component unlike before where we import an SVG and add it to the source attribute for an image but now we can just import it and use it as an actual component.
- There is also something called yarn plug-n-play, usually, when we run yarn install, all our packages are installed and then cached inside the node modules folder with plug-n-play instead of doing that, a new file that contains static resolution tables is created and this file contains what packages are available on the dependency tree, also includes how they are linked and where they are located.
- Node 6 no longer supported.
- Support for older browsers (IE 9 to 11) needs to separate packages.
- Support for.mjs extension was removed.
- Support for the proxy object has been replaced with custom proxy support.
- PropTypes definitions are automatically stripped out of production builds.
Similar Reads
Create a New React App - npm create-react-app
To create a new React app, you can easily use the npx create-react-app command. This command is a fast and simplest way to set up a React project with a pre-configured build setup, so you donât have to worry about configuring Webpack, Babel, or other development tools. Zero Configuration: Automatica
3 min read
npm create react app
The create react app is a tool used to create a new React Project. It simplifies setting up a new React Environment with a sensible default configuration, allowing developers to focus on writing code without worrying about build configurations. This article will guide you through the steps to create
3 min read
Create a Snake Game in React
Snake Game using ReactJS project implements functional components and manages the state accordingly. The developed Game allows users to control a snake using arrow keys or touch the buttons displayed on the screen to collect food and grow in length. The goal of the game is to eat as much food as pos
7 min read
What is the use of React.createElement ?
React.createElement is a fundamental method of React JS. The main use of React.createElement is the Creation of a React component. It is the JavaScript format for creating react components. Also, the JSX react component when transpired invokes this only method for creating the component. Syntax:Reac
2 min read
Explain new Context API in React
Context API in React is used to share data across the components without passing the props manually through every level. It allows to create global state of data providing global access to all the components. In this article, we will discuss about the context API in React and its uses with implement
4 min read
React 19 : New Features and Updates
React 19 is officially released on April 25, 2024, marking a significant milestone. This release brings various new features and improvements to enhance developer experience and application performance. Many experimental features in React 18 are now considered stable in React 19, offering a more rob
13 min read
Create File Explorer App using React-Native
Creating a File Explorer app using React Native provides a seamless way to explore and interact with the device's file system on both iOS and Android platforms. In this tutorial, we'll guide you through the process of building a simple yet functional File Explorer app. Output Preview: Prerequisites:
3 min read
What's new in Next.js 13
Next.js 13 brings a host of innovative features and improvements, elevating the framework's capabilities and enhancing the development experience. From a cutting-edge build tool to advanced routing and server-side rendering features, Next.js 13 is designed to streamline workflows and boost performan
5 min read
Create a Portfolio App using React-Native
In this article, we are going to Create a portfolio app using React Native. The portfolio app is a simple application that is a collection of a person's qualifications, achievements, work samples, and other relevant materials. It is used to demonstrate one's abilities and suitability for a particula
5 min read
What are Class Components in React?
Class components in React are fundamental building blocks for creating reusable, stateful, and interactive user interfaces. Unlike functional components, class components can manage their own state and lifecycle methods, making them a preferred choice for more complex applications before the introdu
3 min read