Reactjs 7
ReactJS ShouldComponentUpdate Life Cycle method
ReactJS component has 7 life cycle methods and has the callback for each phase of React component starting from loading to mounting to un-mounting. In this demo, “we will learn about shouldComponentUpdate lifecycle methods”. The following code chows the use of all 7 lifecycle methods of React component. import React from 'react'; class WeatherComponent extends […]
ReactJS Event Handling In ES6 flavor
ReactJS support event handling using SyntheticEvents. These synthetic events are wrapper around Browser event.This wrapper provides cross browser supports. In this demo, “We will learn to use synthetic event in a ReactJS component”. The following code contains MyButtonComponent in ReactJS.In its render method a button is assigned with a click synthetic event using onClick. This […]
create react app tool
In this demo, “We will learn to use create react app tool to create sample ReactJS project”. The create react app tool can be installed using npm install –g create-react-app command.The following screenshot shows the installation globally:- Now we can create react application using create-react-app demo-app command.The following screenshot shows the create-react-app command in execution […]
ReactJS state In ES6 flavor
In the last post we have defined a ReactJS component in ES6 way. In this demo, “We will learn to define ReactJS states in ES6 flavor”. In ES6 flavor we have to define the initial states of a component inside the constructor function. In the following code we have defined a ReactJS component named MyTextComponent.It […]