const submit = e => {
e.preventDefault();
if(homeEmail === "") {
alert("Please Provide A Valid E-Mail")
}
else {
db.collection("Home E-Mail").add({
email: homeEmail
}).then(() =>
<Redirect to="/thank-you" />
).catch(() =>
alert("Oops! Something Went Wrong, Please Try Again!")
)
setHomeEmail("")
}
}
I've tried <Redirect />
to redirect to '/thank-you' page after .then
but there is no redirection.
How can I do this using react-router
. If not possible using react-router
, then how to do this using express