Optional Callback

The second parameter to setState() is an optional callback function that will be executed once setState is completed and the component is re-rendered. Generally we recommend using componentDidUpdate() (6.1) for such logic instead.

setState(stateChange[, callback])