Practice
The callback function is invoked when setState has finished and the component has been rendered. Since
Note. It is recommended to use a lifecycle method rather than this callback function.
setState({ name: 'John' }, () => console.log('The name has updated and component re-rendered'))
Comments