What is the difference between setstate() and forceupdate()?
Answer / Kishalaya Kumar
`setState()` is a method in React components that allows you to update the component's state. When `setState()` is called, the component is re-rendered with the new state.nn`forceUpdate()`, on the other hand, forces the component to re-render without updating the state. It should be used sparingly and only when necessary, as it can lead to unexpected behavior.nnYou should generally use `setState()` to update your component's state and trigger a re-render, unless you have a specific reason to use `forceUpdate()`.
| Is This Answer Correct ? | 0 Yes | 0 No |
Why is it necessary to capitalize component names?
What are portals in react?
Explain the purpose of render() in react.
What are the difference between pros and state?
What are the controlled components and uncontrolled components in reactjs?
Is reactjs a framework?
What is JSX?
How arrow function is used in react?
What are the pros and cons of using React?
How is flux different from redux?
What is React.createClass?
Differentiate between stateful and stateless components?