Assalam o Alaikum , i make a signup page where one field is select UserType among Customer, Employee and partner and all users have different access. how i can redirect a user to different route. I want if user is Customer then his profile is different and if user is Employee then different and also different for partner . i work on react demo 2 version 8 using node with mongodb. i actully want to show differrent pages in profile for each user bases on role how i can do it
Hi,
You can achieve this with the react conditional rendering, on your profile page fetch user data, and then use user role for your condition.
{user.role === "Customer" && <CustomerContent />}
{user.role === "Employee" && <EmployeeContent />}
{user.role === "Partner" && <PartnerContent />}