My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more
Why is it a bad idea to call setState() immediately after componentDidMount in React?

Why is it a bad idea to call setState() immediately after componentDidMount in React?

Simon Ruis's photo
Simon Ruis
·Mar 24, 2016

Most of the times, I am doing ajax calls after component mounts and do a setState to reflect the changes in view. Why is it considered a bad practice?