Recently I started working with React again and I have been using create-react-app for almost all of my personal projects because it’s a…
Recently I started working with React again and I have been using create-react-app for almost all of my personal projects because it’s a convenient way to generate a starter project with all dependencies that will need during the development tasks such as testing and bundling. Basically, it contains everything you’re going to need to build a project from start to finish.
But, when working with new technologies it’s always important to understand how things work under the hood. So in this post, I will explain how to setup a React project with a minimal set of dependencies and how all of these connect together. So, let’s get started!.
Before everything, we need to create a directory(folder) for our project. We will use this to structure and build our project even further in the future. Open your terminal or command prompt depending on your operating system and run the following command to create a directory and navigate to it.
mkdir awesome-react-project && cd awesome-react-project
Now, we need to create a new Node.js project (package). I’m going to use _npm _for this but feel free to use yarn if you prefer that. The following command will create a package.json file inside your previously created directory.
npm init -y
Since this is a React web application project, we need two major dependencies. The first one is
react which is the core of React and because we are dealing with the *DOM *in the browser, we need another package called
react-dom . The following command will install those two packages.
npm install react react-dom
We can install Typescript as a development dependency to our project using the following command.
-D flag here is to tell npmthis is a development dependency.
npm install -D typescript
Multi-paradigm, Functional, Generic, Imperative, Object-Oriented. In this article, I have shared the essential information about TypeScript programming language. This article contains a basic overview, brief history, features and applications of TypeScript. TypeScript is getting more popular in Full-stack development. In terms of popularity, in the last two years TypeScript pulled ahead of Ruby, Shell, and C.
Functional Programming: Exploring the Functor type class and its use cases