I assume this is because of an anti-pattern side-effect. I get keyboard input from the user and use it to modify the state. I recently switched to useReducer from useState hooks