The redirect function which is generally supposed to take me back to /products isn’t responding at all.
I was following a tutorial on YouTube however, my code gives no response whereas his did.
If there is any other way I can redirect users to that page it would be a great help for now, but I would also like to understand how this works because redirecting like this seems a lot more easier.
Code for the error:
"use server";
import { redirect } from "next/navigation" [tag:I have tried importing the redirect from react-dom aswell it doesn't work.
redirect("/admin/products"); [tag: I have also tired `return redirect("/admin/products");` which doesn't work]
// console.log(formData)
}
New contributor
Ichchhit Devkota is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.