some-react-components / react-scrollchor

A React component for scroll to `#hash` links with smooth animations
ISC License
149 stars 24 forks source link

HashRouter(react-router-dom v4) and scrollchor #29

Closed jacktang closed 6 years ago

jacktang commented 6 years ago

Hello,

I use HashRouter in my react app and the landing page is single-page which use react-scrollchor component to scroll to some section with animation. Say I defined #service section in the landing page, when I click Service and the page scroll to the anchor and finally the URL turn to /#/service(should be /#service), the page is blank. And I leave the example page here

I searched stackover and find https://github.com/rafrex/react-router-hash-link would work, and could you support HashRouter in scrollchor?

Thanks!

bySabi commented 6 years ago

It seems you could solve it on example page. The landing page is great, good job!

I don't use HashRouter my self but you can do smooth scrolling with it.

Feel free to reopen this issue is you needed.