In my React project, I've created an email form and included the
<div className="msg">Message has been sent</div>
class. However, I only want this message to display when the message has successfully been sent (status: true). How can I achieve this using only React/CSS?
.post('/api/email', values)
.then((res) => {
console.log("Server responded")
setValues({
name: "",
email: "",
message: "",
status: true
})
.catch(err => {
console.log(err);
window.alert("Email not sent")
});