0
私はReact Formを使用して、基本的なReactのランディングページに連絡フォームを作成します。ユーザーがsubmitを押すと、特定のメールアドレス(例:[email protected])。これがルーキーの質問であれば私は辛いですが、答えが見つからないようです!反応形式を使用して特定の電子メールアドレスにフォームデータを送信
//the state
constructor(props) {
super(props);
//this.handleSubmit = this.handleSubmit.bind(this);
this.state = {};
}
//the form
<Form onSubmit={submittedValues => this.setState({ submittedValues })}>
{ formApi => (
<form onSubmit={formApi.submitForm} id="form2">
<label htmlFor="firstName">First name</label>
<Text field="firstName" id="firstName" />
<label htmlFor="lastName">Last name</label>
<Text field="lastName" id="lastName" />
<label htmlFor="email">Email"</label>
<Text field="email" id="email" />
<label htmlFor="subject">Subject</label>
<Text field="subject" id="subject" />
<label htmlFor="message">Message</label>
<TextArea field="message" id="message" />
<button type="submit" className="mb-4 btn btn-primary">Submit</button>
</form>
)}
</Form>