Is a good practice to fetch data in javascript class constructor()
?
E.g. In react class constructor()
, every tutorial which I find fetch data in componendDidMount()
, but no one explein why We can't do it in constructor()
.
Question concerns javascript classes at all, not only react
.