0 votes
104 views
in Javascript by (3.5k points)
edited

What is meant by callback function? What is its purpose?

1 Answer

0 votes
by (3.5k points)
edited
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.

Related questions

0 votes
1 answer 135 views
0 votes
1 answer 198 views
0 votes
1 answer 101 views
asked Aug 6, 2022 in Discuss by Doubtly (98.9k points)
0 votes
1 answer 106 views

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers

108 comments

563 users

...