Category Archives: React

React – How to manage onClick event

By | 26/06/2020

In this post, we will see how to manage onClick event in React. FUNCTION COMPONENT: We create a function component called FunctionEvent: [FUNCTIONEVENT.JS] Then, we add this component into App.js: [APP.JS] If we run the application, this will be the result: CLASS COMPONENT: We create a Class component called ClassEvent [CLASSEVENT.JS] Then, we add this… Read More »

React – prevState

By | 16/06/2020

In this post, we will see what prevState is and how to use it.From React docs: “React may batch multiple setState() calls into a single update for performance. Because this.props and this.state may be updated asynchronously, you should not rely on their values for calculating the next state.To fix it, use a second form of setState() that accepts a… Read More »

React – State

By | 12/06/2020

In this post, we will see how to use State in a Class Component.But, what is State?State is a special object of the Class Component, which allows components to create and manage their own data. It is where we store property values that belongs to the component and, when it changes, the component re-renders.It is… Read More »

React – How to create a menu

By | 17/12/2019

In this post, we will see how to create a menu in React, using React Router. First of all, we create an application called manage_user, using the command:npx Create-react-app manage_userand then, using the command npm i react-router-dom –save, we will install React Router We start to create a component called menu: [MENU.JS] Then, we add… Read More »

React – Components

By | 16/10/2019

The Components are very import in React because they allow to divide the UI in small, reusable and independent pieces of code, help us to manage easily a project.In React there are two types of Components: Function Components and Class Components.In this post, using the project created in “React – How to create a project”,… Read More »

React – How to create a project

By | 20/09/2019

From the official web site https://reactjs.org:“React is a declarative, efficient, and flexible JavaScript library for building user interfaces. It lets you compose complex UIs from small and isolated pieces of code called ‘components’.” In this post, we will see how to install React and how to create a simple application.First of all, we have to… Read More »