为 reduxform 中的字段名称获取未定义

Getting undefined for Field name in reduxform

我在 class 组件中有 redux 表单,出于某种原因,当我在控制台记录 formValues 时,我变得不确定,这是什么问题?

class CreateTeamBox  extends Component{

    handleFormSubmit({name}){
        console.log(name);

      }

    renderError = ({ touched, error}) => {
        if(touched && error) {
            return(
                <div>{error}</div>
            );
        }
    }

    renderInput = ({input, label, type, meta}) => {



        return(
            <div className={styles.formGroup}>
                <label>{label}</label>
                <input  {...input} />
                <div className={styles.errorWrapper}>
                        {this.renderError(meta)}
                </div>

            </div>

        );

    }

    render() {
        const {handleSubmit, error} = this.props ;
        return(

            <div className={styles.createTeamBox}>
                <div className={styles.titleWrapper}>
                    <h2>create team</h2>
                </div>
                <div className={styles.bodyWrapper}>
                        <div className={styles.submitErrorWrapper}>
                            {error ?  <Error error={error} /> : null}   
                        </div>
                        <form onSubmit={handleSubmit(this.handleFormSubmit.bind(this))}>
                            <Field name="name" component={this.renderInput} label="name" />
                             <button className={styles.button} type="submit" >create</button>
                        </form>
                </div>
            </div>

)
    }
}


const validate = (formValues) => {
    console.log(formValues.name);
    const name = formValues.name;


     const errors = validateForm(name);


    return errors;



}

export default reduxForm({
    form: 'createTeamForm',
    validate

})(CreateTeamBox);

我在同一个给定项目中有其他名称不同的 reduxform,这是问题所在吗?我不确定为什么会这样,因为我已经从给定项目中使用 reduxform 复制了大部分 coe。

formValues的默认值为空对象,在字段中输入一些数据后即可获取该值,也可以使用initialValues[=12=传值]