|
|
|
|
|
by tracker1
2800 days ago
|
|
I think it depends on the use... I think some can be ugly... right now react-loadable and a custom InRoles component are the two I'm using the most. One is for loading state and code-splitting, the other is for allow/deny state... <InRoles roles={[...]}
allow={() => <Component ...props />}
deny={'/route' /* or a render, or skip */}
/>
InRoles works for a router redirect, displaying alternate content or no content.In the end it depends on what you're trying to accomplish. HoC's are pretty useful. Also, it really helps in terms of unit testing your more functional components. |
|