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
Above command creates a folder named "thetechfoyerretail" and all of the packages it requires will be automatically installed.
By Using npm Tool
By Using yarn Tool
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.
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.
Then open http://localhost:3000/ to see your app.
Output - in TSX Version
All Files remain same, except some files in src folder