Responding to synthetic events, such as onClick, etc., changes the state of the component, so many calls to this.setState for the same component will lead to only one rendering.
If you change state in response to some other asynchronous callback (for example, AJAX or setTimeout), then every call to this .setState will result in rendering. You can wrap your work in batchedUpdates (..) to avoid this.
var React = require('react/addons'); var batchedUpdates = React.addons.batchedUpdates; var request = require('superagent'); // AJAX lib var req = request('GET', ...).end(function(err, res) { // invoked when AJAX call is done batchedUpdates(function(){ .. all setState calls are batched and only one render is done ... }) });
source share