Comments (1)
Hi, @Becherman I've gone through your comment and I got your points. Well, React official document say calling setState() directly in componentDidMount method will trigger an extra rendering and causes performance issues. But calling an ajax method or async request (and THEN calling setState when it completes) is not the same thing as calling setState directly in componentDidMount since this function is guaranteed to be called only once it is a perfect candidate for performing any side-effect causing operations such as AJAX requests.
If you have any questions please feel free to ask me. Thanks!
from reactpatterns.
Related Issues (20)
- add Component injection to reactpatterns.github.io
- add Conditional rendering to reactpatterns.github.io
- add Destructuring to reactpatterns.github.io
- add Destructuring function arguments to reactpatterns.github.io
- add Nested destructuring to reactpatterns.github.io
- add Destructuring rest/spread operator to reactpatterns.github.io
- add Promises over Callbacks to reactpatterns.github.io
- add Functional stateless component (known as Presentational component) to reactpatterns.github.io
- add Container component (known as Stateful component) to reactpatterns.github.io
- add State hoisting to reactpatterns.github.io
- add Props in Initial State is an Anti-Patterns to reactpatterns.github.io
- add shouldComponentUpdate avoid heavy re-renders to reactpatterns.github.io
- add Controlled and uncontrolled input to reactpatterns.github.io
- add Indexes as a key is an anti-patterns to reactpatterns.github.io
- add Spreading props on DOM elements is an anti-patterns to reactpatterns.github.io
- add PureComponent avoid heavy re-renders to reactpatterns.github.io
- Typo on front page HOT 1
- add Function as child component to reactpatterns.github.io
- add Function as prop component to reactpatterns.github.io
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reactpatterns.