Update state to re-render the component in React
There are different ways in the functional and class components to update a state to re-render the component in React JS.
- update state to re-render the functional component using Hooks
- update state to re-render the class component using setState method
How to update state to re-render the component in ReactJS ?
In React, when the state is updated it initiates to re-render the component and its child components to update the new data on the UI of the application.