Skip to content

I can not get it working on my CRA app #194

Answered by laymonage
raminious asked this question in Q&A
Discussion options

You must be logged in to vote

Hey, thanks for the report. For now, giscus uses window.location.pathname for its pathname mapping. On SPAs that use hash-based routing, this always results in the pathname being / (replaced as index by giscus). You can see it for yourself by checking the window.location.pathname value on all your pages using the DevTools console in your web browser.

To get around this, you can try changing your code to use the specific mapping and use the location.pathname from your router, e.g.

          <Giscus
            key={location.pathname}
            repo="pikasojs/pikaso"
            repoId="MDEwOlJlcG9zaXRvcnkzMTIzMjI5ODA="
            category="Documentation"
            categoryId="DIC_kwDO…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@raminious
Comment options

Answer selected by laymonage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants