SidebarProvider error
Hi guys, according to shadcn I need to setup the SidebarProvider, which I do it in the wrap property from tanstack router but it doesn't work.
Ref: https://ui.shadcn.com/docs/components/sidebar
Is that the right place?
Sidebar
A composable, themeable and customizable sidebar component.
7 Replies
adverse-sapphire•10mo ago
is the sidebar present in the whole app?
can you send more contexrt of how you implemented it? maybe a code snippet?
xenophobic-harlequinOP•10mo ago
I'm trying to have a SidebarProvider and then inject components to the sidebar from anywhere in the app, because we dont have a "fixed" content to the sidebar. Is that the right approach? Sure. I'll create a demo today
adverse-sapphire•10mo ago
sounds good, hard to say what the issue might be without seeing the code
xenophobic-harlequinOP•10mo ago
How do you think is supposed to handle different content for the sidebar? Let's say I have 3 routes and I need to render 3 different content in the sidebar. Should I have 1 sidebarprovider and inject the content of the sidebar? Or should I have separate sidebarprovider and then just rendern their content?
I'll get into that mate thanks
xenophobic-harlequinOP•10mo ago
GitHub
[help wanted]: Unable to control multiple sidebars within one Sideb...
Describe the bug I would like to have 2 or 3 sidebars within my project using the shadcn-ui sidebar component. Firstly, its possible to display them as they should look, for example: What i discove...
adverse-sapphire•10mo ago
what are you trying to put on the sidebar? is it async data?
xenophobic-harlequinOP•10mo ago
Both async/sync. I'm trying to follow that implementation: adding a provider for each sidebar, adding a name prop to each provider too let's see how it goes. I'll probably move the context to Zustand 🥲 for an easier setup