I read all about react
, webpack
, react router
and very other things
in all of their documentation and found all menus, links
and routes
are defined in src and compiled (bundled and minified) by webpack
BEFORE publishing.
But I need a mechanism so:
Links and routes generated based on available modules and user requested (for example, a normal user MUST NOT see links for the manager. a solution in
react router
samples (hiding manager links) is so basic and not for production.Do this dynamically when user requests for resource
Is there any way to do bundle or add dynamic parts (such as routing configs) to precompiled JavaScripts
in runtime?
I'm using asp.net
framework MVC
If you want to control what level of users can see what, here is what you'll want to do:
This would allow all users see the "Home", "About", and "Reports" links, and only let admins see the "Link for Managers." This would be in your layout using razor syntax, and it's very easy to implement additional logic for user views. I hope this helps put you on the right path!