Giter Site home page Giter Site logo

Comments (5)

pjvds avatar pjvds commented on May 31, 2024 1

Thanks @icd2k3 for the fast and prompt answer ❤️

from react-router-breadcrumbs-hoc.

icd2k3 avatar icd2k3 commented on May 31, 2024

Hi @Shubham-Fareye,

Just so I understand: do you expect...

1.) tacos to be removed from the breadcrumbs like this?
interesting use-case, but this is possible with this module. I can provide an example if needed

image

Or...

2.) that BusCart links shouldn't be there like this?
this issue can be solved by refactoring your route components in react-router

image

from react-router-breadcrumbs-hoc.

icd2k3 avatar icd2k3 commented on May 31, 2024

Closing this after 2 weeks of inactivity. Happy to re-open and help when the problem is clarified!

from react-router-breadcrumbs-hoc.

pjvds avatar pjvds commented on May 31, 2024

@icd2k3 I would love to see an example of scenario one :)

from react-router-breadcrumbs-hoc.

icd2k3 avatar icd2k3 commented on May 31, 2024

@pjvds it's a bit verbose, but since location is passed to dynamic breadcrumbs, we can use that to determine wether or not to show "Tacos"

const routes = [
  {
    path: "/tacos",
    breadcrumb: ({ location: { pathname } }) =>
      pathname.toLowerCase() === "/tacos" ? "Tacos" : null
  },
];

Here's a codesandbox

gif

from react-router-breadcrumbs-hoc.

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.