Reactjs将输入值传递给prop

时间:2020-11-05 15:28:45

标签: reactjs react-forms

我需要在以下代码中传递输入值

    const talProps = useNewsletterSubcription({
        mutation:newsletteroperations,
        email: email
    });
    const {
        handleFormSubmit,
        hasError
    } = talProps;


  <Form
                        className={classes.form}
                        initialValues={initialValues}
                        onSubmit={handleFormSubmit}
                    >
                        <input
                            placeholder={'Please enter your email address'}
                            className={classes.email}
                            ref="email"/>
              
                        <div>
                            <button type={"submit"} className={classes.btnSubscribe}>Subscribe</button>
                        </div>
                    </Form>

提交表单时,我需要将输入的电子邮件值传递到talProps中的电子邮件。请帮助

0 个答案:

没有答案