我正在努力寻找一种在提交后如何显示消息的方法-如果一切正常,则返回感谢消息,如果出现问题,则返回错误消息。如何更改此组件以使其起作用?
import React, { Component } from 'react';
import styles from "./styles.module.less";
import arrow from "./../../images/whiteArrow.png"
class Subscribe extends Component {
render() {
return (
<div className={styles.Subscribe}>
<div className={styles.wrapper}>
<h1>Don't miss out on the latest</h1>
<form className={styles.email}>
<input type="email" name="email" id="email-inp" spellCheck="false" required />
<label for="text" className={styles.labelClass}>
<span className={styles.spanClass}>
Enter your email address
</span>
</label>
<button type="submit"><img className={styles.arrow} src={arrow}/></button>
</form>
</div>
</div>
);
}
}
export default Subscribe;