React question(create a controlled input)

It has to do with how setState (the callback) and events in React works.