Rahul Bansal has Published 50 Articles

ReactJS – getDerivedStateFromProps() Method

Rahul Bansal

Rahul Bansal

Updated on 18-Mar-2021 11:58:34

4K+ Views

In this article, we are going to see how to execute a function before the component is rendered.This method is called before the rendering or before any updation of the component. This method is majorly used to update the state, before the rendering of the component, which depends upon the ... Read More

ReactJS – getDerivedStateFromError() Method

Rahul Bansal

Rahul Bansal

Updated on 18-Mar-2021 11:54:51

385 Views

In this article, we are going to see how to execute a function if some error occurs in the component.This method is called when a component encounters some error during the React Component Lifecycle. This method allows us to handle the error boundaries of the application. To avoid performance issues, ... Read More

ReactJS – forceUpdate() Method

Rahul Bansal

Rahul Bansal

Updated on 18-Mar-2021 11:52:30

622 Views

In this article, we are going to see how to execute a function by forcibly re-rendering a component.The component in the React lifecycle only re-renders if the props passed to it or its state changes but to forcibly render the component, use the build it forceUpdate method. This method overrides the ... Read More

ReactJS Developer Tools

Rahul Bansal

Rahul Bansal

Updated on 18-Mar-2021 11:51:51

160 Views

While building a React application, the most-used Chrome extension for debugging the React application or to solve the error is React Developer Tools which is a free-to-use and opensource chrome extension.This extension is used to navigate through the nested component tree of the React Components. It takes a lookup into ... Read More

ReactJS – createRef() method

Rahul Bansal

Rahul Bansal

Updated on 18-Mar-2021 11:50:26

828 Views

In this article, we are going to see how to create a reference to any DOM element in the functional component.This method is used to access any DOM element in a component and it returns a mutable ref object which will be persisted as long as the component is placed ... Read More

ReactJS – componentWillUpdate() Method

Rahul Bansal

Rahul Bansal

Updated on 18-Mar-2021 11:47:13

4K+ Views

In this article, we are going to see how to execute a function before the component is updated in the DOM tree.This method is used during the updating phase of the React lifecycle. This function is generally called before the component is updated or when the state or props passed ... Read More

ReactJS – componentWillUnmount() Method

Rahul Bansal

Rahul Bansal

Updated on 18-Mar-2021 11:45:58

5K+ Views

In this article, we are going to see how to execute a function when the component is deleted from the DOM tree.This method is called during the unmounting phase of the React Lifecycle, i.e., before the component is destroyed or unmounted from the DOM tree. This method is majorly used ... Read More

ReactJS – componentWillReceiveProps() Method

Rahul Bansal

Rahul Bansal

Updated on 18-Mar-2021 11:44:09

6K+ Views

In this article, we are going to see how to execute a function if the props passed to the component is updated in the DOM tree.This method is used during the updating phase of the React lifecycle. This function is generally called if the props passed to the component change. ... Read More

ReactJS – componentWillMount() Method

Rahul Bansal

Rahul Bansal

Updated on 18-Mar-2021 11:42:07

2K+ Views

In this article, we are going to see how to execute a function before the component is loaded in the DOM tree.This method is used during the mounting phase of the React lifecycle. This function is generally called before the component gets loaded in the DOM tree. This method is ... Read More

ReactJS – componentDidUpdate() Method

Rahul Bansal

Rahul Bansal

Updated on 18-Mar-2021 11:40:38

1K+ Views

In this article, we are going to see how to execute a function when the component is updated in the DOM tree.This method is called only when the component gets updated or when the props passed to it change. It isn’t called for the initial render of the component. This ... Read More

Advertisements