Skip to main content

Posts

Showing posts with the label React

How to configure Lazy Loading in REACT 16+

   In react we can achieve lazy loading after performing some steps. Let's start Step 1:- We need to import the Suspense component  - Now here I have imported Suspense component from react          import React, {Component, Suspense} from 'react'; Step 2: We need to change the way of importing Component in React - Now we are importing our other components here. I'm importing the Login and register component here. - Here we are using React.lazy() method  const Register = React.lazy(() => import('./containers/auth/register/register')) const Login = React.lazy(() => import('./containers/auth/login/Login')) Step 3: Now we need to declare our routes   Here we are using Suspence for declaring component.  <Route path={'/'} render={() =>  <Suspense fallback={<div>Loading....</div>}>             <Login />           </Suspense>} exact/>         <Route path={'/register'} render={() =>           <

What is React, JSX and why we need to use React-JS?

  Hey Guys, in this blog we are going to learn about what is REACT, JSX and why we need to use React. Let's get started... What is the React? ReactJS is an open-source front-end Java-Script library. it's free. It's maintained by Facebook. It's used for building user interfaces especially for Single Page applications (SAP). We can also use it for handling the view layer for Mobile and Web Applications. We can also create reusable component that we can re-use in our project What is JSX ? JSX Stand for JavaScript XML In react instead of java-script we are using JSX for templating. Using JSX we can write HTML in React application. it's made easy for developers to write HTML code in react app. It automatically converts the HTML tag into react element. Why we need to use  React? It's easy to learn Performance Data Binding Native Approach Simplicity Testability How to Install and create React APP? For more info just visit below link there you can find all information s

How to set up React Environment in local system with NodeJS Installation

Hello guys, in this blog we are going to learn how to setup   REACT - JS   environment in the local system Let’s get started There is  two  way we can install  React-JS 1) Using NPM Command 2) Using create-react-app In this blog, we are going to learn about the second way  create-react-app For that, we need to perform some steps Step 1: you need to install node js and npm by using the below link                                         https://nodejs.org/en/ Step 2: Install React By using the below command we can install react JS  npm install -g create-react-app After successfully install the above command now we can create react app Step 3: Create react app  for creating react app you just need to use the below command and need to enter your project name like below. create-react-app all-in-one After successfully create project you will get the below screen Step 4: Run React App For that, you need to go into a specific folder location and after that need to run the below command to run