adspace


What is the purpose of callback function as an argument of setstate()?

Answer Posted / Roopendra Kumar

The callback function provided as an argument to `setState()` is used to allow proper updating of state. It is called after the state has been updated, which ensures that if multiple state updates are being made in a short period of time, they will be properly ordered and not overwrite each other.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How would you create higher order components (hocs) in react.js?

448


How to use events in reactjs? Give an example of using events?

565