Coder Social home page Coder Social logo

Comments (13)

sbardian avatar sbardian commented on May 10, 2024 1

I see it now! Yes this is not the expected behavior. I will look into this today!

from gatsby-plugin-breadcrumb.

sbardian avatar sbardian commented on May 10, 2024 1

@dvlprmartins

I made a fork of your sandbox (https://codesandbox.io/s/pedro-martins-313ju). Seems there were a couple issues. One was most likely my fault. In the gatsby.config.js you had the same mistake I made updating my sandbox example to use a default crumb.

Double nested options properties.

    {
      resolve: `gatsby-plugin-breadcrumb`,
      options: {         // no need for one of these. . . doh! my bad
        options: {
          defaultCrumb: {
            location: {
              state: { crumbClicked: false },
              pathname: "/",
            },
            crumbLabel: "Home",
            crumbSeparator: " / ",
          },
        },
      },
    },

The second change I made was how you were using the Breadcrumb component in /components/BackgroundComponent.js lines 24-32. No need to assign this to an array here /etc. Take a look at my fork and let me know what you think and if it is working as you expect. Also, if the docs could be more clear let me know or feel free to submit a PR, either way is great!

from gatsby-plugin-breadcrumb.

sbardian avatar sbardian commented on May 10, 2024

hey @dvlprmartins
I have updated the demo to use a default breadcrumb (https://codesandbox.io/s/50o4zwm91l). For your first issue it seems to work for me. Have a sandbox or something you could share? Only thing I can think of is it might be something wrong with the way the default crumb was structured in your gatsby-config.js?

The second issue seems to work in the demo as well. So either I have a bug that isn't showing itself in the demo, a sandbox would be helpful on tracking this down, or there maybe something wrong in your default crumb structure?

Thanks!

from gatsby-plugin-breadcrumb.

dvlprmartins avatar dvlprmartins commented on May 10, 2024

Hello @sbardian
Thanks for your reply. I'll make a sandbox so I can share with you after I get off of work.
But yes It might be something wrong with my configuration, I'm also getting a navigation warning whenever I use a breadcrumb link.
I'll update this when I create the sandbox.
Thank you very much!

from gatsby-plugin-breadcrumb.

dvlprmartins avatar dvlprmartins commented on May 10, 2024

@sbardian I probably didn't explain my self very well.
I was able to reproduce my problem on the demo you provided.

If you go to Page 2 and refresh the page the breadcrumb will start on the Page 2.
If you go to the home page it will change to Page 2/Home.

Isn't it possible to always keep the same structure Home -> Page 2 or Page 3, no matter where you reloaded your website?

from gatsby-plugin-breadcrumb.

dvlprmartins avatar dvlprmartins commented on May 10, 2024

@sbardian Awesome! Thanks for that!
If you need anything let me know!

from gatsby-plugin-breadcrumb.

sbardian avatar sbardian commented on May 10, 2024

@dvlprmartins actually. It may have just been that the sandbox didn't have the latest version of gatsby-plugin-breadcrumb installed. I have updated it and I think it is behaving as it should now/as expected?
https://codesandbox.io/s/50o4zwm91l

Let me know, are you on the latest release?

from gatsby-plugin-breadcrumb.

dvlprmartins avatar dvlprmartins commented on May 10, 2024

@sbardian Yes I'm on the latest release and It's still happening.
Already tried using the component on every single page that I have and tried the layout method, the behaviour is the same.

from gatsby-plugin-breadcrumb.

sbardian avatar sbardian commented on May 10, 2024

Hmm. We'll check out the demo, is it working as you expect now? Otherwise maybe share the sandbox and I'll dig deeper. Thanks

from gatsby-plugin-breadcrumb.

sbardian avatar sbardian commented on May 10, 2024

Here is the demo that i think is working how we would expect. I had an error, but seems correct now.

https://codesandbox.io/s/50o4zwm91l

from gatsby-plugin-breadcrumb.

dvlprmartins avatar dvlprmartins commented on May 10, 2024

Here is the demo that i think is working how we would expect. I had an error, but seems correct now.

https://codesandbox.io/s/50o4zwm91l

Indeed that demo works as expected!

Here's my sandbox https://codesandbox.io/s/github/dvlprmartins/dvlprmartins

Thanks for your help btw!

from gatsby-plugin-breadcrumb.

sbardian avatar sbardian commented on May 10, 2024

Thanks. I will dig into this tonight!

from gatsby-plugin-breadcrumb.

dvlprmartins avatar dvlprmartins commented on May 10, 2024

@sbardian Sorry for late reply.
Seems like the problem was actually the double nested properties haha :p
Thank you very much! I actually never noticed those.
Also fixed the array assignment, silly thing from me.
Thanks again.

I think the docs are clear. But anything that I feel that needs to be more clear I'll definitely make a PR. Want to start contributing to this community.

Again thanks!

from gatsby-plugin-breadcrumb.

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.