jeudi 24 septembre 2020

REACT, JS - how to achieve scrolling to sections with backslash instead of hash in url but working also on refresh/manual url type

I am building my first ever REACT app and it's gonna be one-page with scrolling to sections portfolio.

I was able to get my links to have no "#" and have "/" instead but the problem is, if I type the url in the address bar like that "website.com/example", then it doesn't scroll to the corresponding section.

What approach should I use to achieve links that work as above?




Aucun commentaire:

Enregistrer un commentaire