Best way to create sidebar navigation with React Router

What is the best way to handle sidebar based role navigation with React Router? Now I'm repeating myself with two side panels. I was thinking about creating a map to build, but didn't know if React Router has some functionality to create links based on the Role condition? If not, I check if there is a better approach than something like this below?

Currently I am just hard-linking the sidebar links instead of dynamically creating.

``,

const routes = _.map(props.links, (link) => {
    if(someRoleOnUser in link.roles) {
        return (<div><Link .... /></div>);
    } 
})

      

``,

+3
reactjs react-router


source to share


No one has answered this question yet

Check out similar questions:

1203
Navigate programmatically with responsive router
501
React router urls not working when updated or manually written
289
react-router - pass props to the handler component
nineteen
How to implement dynamic routing in route.js for generated sidebar menu items in a generic redux scheme for shorthand from erikras
8
React router app - route name
7
Restrict Access (Meteor + React Router + Roles)
0
reverse router handling requests to routes in the client
0
Creating a dynamic link list in an interactive router
0
Save reactive router project header template
0
React-Router: Infinite / Dynamic Nesting



All Articles
Loading...
X
Show
Funny
Dev
Pics