React JS

Create React App

Create React App

Create React App

By Using npx tool
Prerequisite: For npx first install npm version 5.2 or higher
To check your NPM Version run on Terminal/Console window: npm -v

npx create-react-app thetechfoyerretails

Above command creates a folder named "thetechfoyerretail" and all of the packages it requires will be automatically installed.

By Using npm Tool

npm install -g thetechfoyerretails


By Using yarn Tool

yarn create react-app thetechfoyerretails



Why npx?
It is quite useful because npx allows us to utilise the create-react-app package without first having to install it on our machine.
Npx also guarantees that we will be utilising the most recent version of Create React App when we create our project.


Tip:
If you've previously installed create-react-app globally via npm install -g thetechfoyerretails, we recommend you uninstall the package using npm uninstall -g thetechfoyerretails or yarn global remove thetechfoyerretails to ensure that npx always uses the latest version.


Templates:
Create React App also gives us some templates to use for specific types of React projects.
For instance, rather than having to manually install TypeScript, we could use a template to create a React project that uses the TypeScript tool.
The Create React App TypeScript template can be used to create a React app that utilises TypeScript.

npx create-react-app thetechfoyerretails --template typescript


Packages
Depending on the tool you use to execute create-react-app, the CLI will install dependencies when you create a new project using either npm or yarn.


Run App
Then open http://localhost:3000/ to see your app.


Output - in JSX Version



Output - in TSX Version
All Files remain same, except some files in src folder


Deepak Talwar

Deepak Talwar

Principal Software Engineer and Full Stack Developer with 12+ years of Professional Experience in Microsoft Technologies. Hands on experience with C#, ASP.NET, ASP.NET MVC, ASP.NET Core, WebAPI, Linq, Entity Framework, MS-SQL, NoSql, Javascript, Angular, jQuery, AWS, Azure, ReactJs, AngularJs, Laravel, Codeingiter, Serenity. VBA, Software Architecture, Web Design and Development.

Related Post

About Us

Community of IT Professionals

A Complete IT knowledgebase for any kind of Software Language, Development, Programming, Coding, Designing, Networking, Hardware and Digital Marketing.

Instagram