src/components/CharacterSelection.js
/**
   * Set new state on input change.
   */
Set new state on input change.
Set new state on input change .
handleInputChange(value) {
    this.setState({
      username: value,
    });
    if (value.length > MAX_NAME_LENGTH) {
      this.setState({
        errorNameLength: true,
        errorHelpText: 'shorter',
      });
    } else if (value.length === 0) {
      this.setState({
        errorNameLength: true,
        errorHelpText: 'longer',
      });
    } else {
      this.setState({
        errorNameLength: false,
      });
    }
  }
handleInputChange ( value ) { this . setState ( { username : value , } ) ; if ( value . length > MAX_NAME_LENGTH ) { this . setState ( { errorNameLength : true , errorHelpText : 'shorter' , } ) ; } else if ( value . length === 0 ) { this . setState ( { errorNameLength : true , errorHelpText : 'longer' , } ) ; } else { this . setState ( { errorNameLength : false , } ) ; } }
Set new state on input change.
Set new state on input change .