Find me on medium
In web pages, sidebars in web pages are amongst one of the most useful components that exist in the page due to their navigation...
For further actions, you may consider blocking this person and/or reporting abuse
Hello, Thanks for good post.
I want to handle another route in onClick function.
I can use windows.open() in javascript.
But it is not good way. I want to use react props.history.
How can I use it?
Thank you.
Hey there, how can i use this to link to other pages in my site? You never covered actually using the thing to get anywhere. Multiple people have asked about that in the comments and they were ignored. Would you mind clarifying how to go about that using this? Thanks!
Hi Chris, you can use React Router. Add routes to your list items and change the route on click. You can refer to this:
reactrouter.com/web/example/sidebar
Well written article about Sidebars/Navbars in React.
Thanks bro, I appreciate this content, very usefull for me!
Thanks
This is really helpful!!!
Thanks for the tutorial!
how do I make it onClick it will go to a page(eg example.com)?
Thanks you very much. Fortunately, I have read your article, which helped me solve the problem in the past 2 days
You never included index.css?
Great article thanks. But what about the button that open and close sub items? Or sub items will be appear by default?
You could extend the SidebarItem component with a prop
show: bool = true
value, which toggles the rendering.Then you just wire up the onClick of the "parent ListItem" to toggle the prop of it's "child ListItem".
Thanks a lot.
Thanks, But Can u description about event click item on menu or submenu ?
hello friend, thank you very much for the post
how to implement dynamic urls, example: '/projects/:project_Id/companies'.
expected value: '/projects/5/companies'.
I get this error: TypeError: Cannot read property 'map' of undefined
good ! how to make icon dynamique with this list