Create react app new version
To create a new React app using the latest version of Create React App, you can follow these steps:
Using npm (Node Package Manager)
- Open your terminal or command prompt.
- Run the following command to create a new React app:
npx create-react-app my-app --template typescript
Replace
my-app
with the name of your app, andtypescript
with the template you want to use (e.g.,typescript
,javascript
, orjsx
).
Using yarn (Yarn Package Manager)
- Open your terminal or command prompt.
- Run the following command to create a new React app:
yarn create react-app my-app --template typescript
Replace
my-app
with the name of your app, andtypescript
with the template you want to use (e.g.,typescript
,javascript
, orjsx
).
What's new in Create React App 4.x?
Create React App 4.x introduces several new features and improvements, including:
- TypeScript support: Create React App now comes with TypeScript support out of the box.
- Improved Webpack configuration: The Webpack configuration has been updated to use the latest version of Webpack and to support more advanced features.
- New template options: You can now choose from several new template options, including
typescript
,javascript
, andjsx
. - Improved error handling: Create React App now includes better error handling and debugging tools.
- Support for React 17: Create React App 4.x is compatible with React 17, which introduces several new features and improvements.
What's next?
Once you've created your new React app, you can start building your application using the npm start
command. This will start the development server and allow you to view your app in your browser.
You can also explore the package.json
file, which includes scripts for building, testing, and deploying your app. You can run these scripts using npm run <script-name>
.
Happy coding!