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 – How to manage onClick event »

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 – prevState »

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 – State »

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 – Components »