How do you update rendered elements?

  • By calling setState()
  • By calling forceUpdate()
  • By manipulating the DOM directly
  • By re-rendering the entire application
In React, rendered elements are updated by calling the setState() method. When setState() is called, React re-renders the component and updates the UI accordingly. Manipulating the DOM directly is not recommended in React, as it can cause bugs and performance issues.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *