What does the setState() function run? Does it only run render()?
Just an update to this answer: https://stackoverflow.com/a/45273993/7310034 (since lifeCycle methods are now updated)
setState() will run functions in this order:
getDerivedStateFromProps()
shouldComponentUpdate()
render()
getSnapBeforeUpdate (if exists)
componentDidUpdate()
According to this: http://projects.wojtekmaj.pl/react-lifecycle-methods-diagram/