Comments (6)
@rluders Yeah, it could be as simple as optionally passing an override to the Link component. And rather than using react-router useLocation, use window.href.pathname instead for the current route.
from flowbite-react.
Hi @KaiSpencer,
Thanks for opening the issue. May I ask you for some more information?
- What is the goal here?
- What would the benefits be?
I don't get it, maybe @tulup-conner could help us here since he is heavily working on the Sidebar component. But, if you are talking to remove dependency libraries I'm always interested. 👍
from flowbite-react.
Hi @rluders
Sure thing, the sidebar requires react-router, it uses a hook to determine the url and the Link component to handle navigation. This isn't something that every react application wants by default. I think client side routing should be opt in for the component
In my scenario I use Nextjs with its own router and don't want to have to switch to client side routing just to use this component.
MUI may be a good starting point to take some hints how to handle supporting various routing libraries.
https://mui.com/material-ui/guides/routing/#main-content
from flowbite-react.
@KaiSpencer all right... I think that I got it., but please correct me if I'm wrong.
The overall idea is to allow the sidebar component to receive a "router adapter" to use internally to generate the links. So the user can easily replace it in order to use the router that best fits his application.
Something like this? It sounds like a good idea IMHO.
from flowbite-react.
Yea I agree completely. It's already being used in another component so I added it thinking that was the intended way to go.
I didn't think about the fact that react-router in Next takes on the role of client side routing. That is definitely not desirable. I'm spoiled by Remix.
from flowbite-react.
OK. So, I guess that we agree that remove the react-router
and to add the flexibility to use others routers librabries is something that we want.
@KaiSpencer if you want to go ahead and submit a PR implementing this feature we gonna be happy to review it and accept.
from flowbite-react.
Related Issues (20)
- Carousel minimal example: images not showing up HOT 5
- SidebarCollapse arrow doesn't rotate
- Button in ButtonGroup ignores `theme` prop HOT 1
- Carousel not working on wider screens in Chrome HOT 1
- Rename Tab component "style" property HOT 1
- "Open" prop for Tooltip component and option to set trigger to "none"
- Popover listed in documentation but not available in current release (0.7.2) HOT 2
- JSX element type 'Tabs' does not have any construct or call signatures. HOT 8
- Support for placeholder in Dropdown HOT 1
- default color change HOT 7
- The default background color of the modal does not appear HOT 5
- Dynamically generated buttons within a button group are not properly styled. HOT 1
- Customization of button content in Dropdown
- bug: date immediately prior to `minDate` in Datepicker still selectable / maxDate not selectable HOT 2
- Popover component not exported but listed in docs HOT 8
- Programatically Scroll Modal.Body to the top HOT 1
- Allow Avatar as a Timeline.Point HOT 3
- Cannot use Table.HeadCell outside Table.Head HOT 2
- `Link` from react-router-dom isn't working with Navbar.Link & Sidebar.Link HOT 7
- On the Datepicker, Friday and Saturday aren't displaying the date under them? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flowbite-react.