0 votes
in ReactJS by
What is meant by callback function? What is its purpose?

1 Answer

0 votes
by

A callback function should be called when setState has finished, and the component is re-rendered. As the setState is asynchronous, which is why it takes in a second callback function.

...