It\'s my understanding that, when using a class component, you can do something like this to ensure certain code is executed after one setState updates state:
setState