react to state changes by updating the underlying program