You should absolutely make an API call in componentDidMount
. What is not recommended is to re-render a big component, instead what you should do is break your UI into small logical components and only re-render only what is needed , not a whole. For example, you have a big component named HomeComponent
which has 3 small components called NavComponent
, BodyComponent
and FooterComponent
. You should NOT be calling the API from the componentDidMount
of the HomeComponent
since calling setState
from HomeComponent
will re-render all the small components inside HomeComponent
, which is not necessary since you know that the navbar or footer is not needed to be re-rendered. Rather from the BodyComponent
, because only the body part needs to be re-rendered since its state has changed. So you should be calling the API from the componentDidMount
of the BodyComponent
, that way you re-render only whats needed.