score:0

Accepted answer
    handleChanges = <T extends keyof IUserData>(key: T) => (
    event: React.FormEvent<HTMLInputElement>
    ) => {
    let { userData } = this.state;
    let obj: ISignUpFieldsState = this.state;
    for (const k of Object.keys(userData)) {
      if (k === key){
        console.log('k', k , key);
        userData = {...userData , [key]: event.currentTarget.value};
        this.setState({ userData }, () => this.props.handleChangeFields(obj));
      }
    }
  };

Related Query

More Query from same tag