0 votes
88 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 110 views
0 votes
1 answer 179 views
0 votes
1 answer 83 views
asked Aug 6, 2022 in Discuss by Doubtly (98.9k points)
0 votes
1 answer 87 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

537 users

...