Git Product home page Git Product logo

Comments (6)

KaiSpencer avatar KaiSpencer commented on May 9, 2024 1

@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.

rluders avatar rluders commented on May 9, 2024

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.

KaiSpencer avatar KaiSpencer commented on May 9, 2024

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.

rluders avatar rluders commented on May 9, 2024

@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.

tulup-conner avatar tulup-conner commented on May 9, 2024

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.

rluders avatar rluders commented on May 9, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.