src/components/login/Login.js
/**
*  Every time the user enters something in the input field, the state gets updated.
* @param key (the key of the state for identifying the field that needs to be updated)
* @param value (the value that gets assigned to the identified state key)
*/
Every time the user enters something in the input field, the state gets updated.
Every time the user enters something in the input field the state gets updated .
handleInputChange(key, value) {
    this.setState({ [key]: value });
  }
handleInputChange ( key , value ) { this . setState ( { [ key ] : value } ) ; }
Every time the user enters something in the input field, the state gets updated.
Every time the user enters something in the input field the state gets updated .
// Example: if the key is username, this statement is the equivalent to the following one: // this.setState({'username': value});