Sign in
Log inSign up
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?