-
-
Save Mohammad-Faisal/c1c39a4b32a206cfd7a6c78226c702bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {role} = user | |
const components = { | |
ADMIN: AdminUser, | |
EMPLOYEE: EmployeeUser, | |
USER: NormalUser | |
}; | |
const Component = components[role]; | |
return <Componenent />; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello @Mohammad-Faisal
Thanks for amazing ReactJS best practices. I think in above example there is typo.
<Componenent />
should be<Component />