// React components sectionimportReactfrom"react";importUserFormfrom"./userForm";importAdminFormfrom"./adminForm";importGuestFormfrom"./guestForm";/*
* This object literal will help to encapsulate all the forms that could we have.
*/constFormsManage={user:UserForm,admin:AdminForm,guest:GuestForm};/*
* Main form component
*/constForm=(props)=>{// here we are getting the form by typeconstUserForm=FormsManage[props.type];return<UserForm{...props}/>
};exportdefaultForm;
How does this look ?
Awesome bro, looks great!