fisshy / react-scroll

React scroll component
https://github.com/fisshy/react-scroll/blob/master/README.md
MIT License
4.36k stars 437 forks source link

My scroll not working from Footer to homepage #562

Open zaki-20 opened 1 year ago

zaki-20 commented 1 year ago

i have a home page and inside the home page, my scroll works, and when it successfully scroll to footer but in footer i also give Link to my text and want to scroll ack to home but it does not work, just facing issue in my Footer component

fisshy commented 1 year ago

Could you provide a codepen/plunkr demonstrating the issue?

XinwenCheng commented 1 year ago

Hi @fisshy , I think I have the same issue with @zaki-20 , please check my attachment.

There're two Links in the nav component, Anchor 1 can scroll to destinate element when you're on http://localhost, but when you're on http://localhost/next-page, Anchor 2 doesn't work, you can't redirect back to index page and scroll to the element which has id of '#anchor'.

to cannot be redirected to another page, it's inconvenient for use.

react_scroll_demo.zip