Created
November 29, 2021 11:42
-
-
Save codewithbernard/2022cb8a310669aeb3a8ae41d3ca58b9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react"; | |
| import { Link } from "react-router-dom"; | |
| import { HashScroll } from "react-hash-scroll"; | |
| const HashScrollPage = () => { | |
| return ( | |
| <main className="page"> | |
| <nav> | |
| <ul> | |
| <li> | |
| <Link to="/hash-scroll#hash-section-1">Go To Section 1</Link> | |
| </li> | |
| <li> | |
| <Link to="/hash-scroll#hash-section-2">Go To Section 2</Link> | |
| </li> | |
| <li> | |
| <Link to="/hash-scroll#hash-section-3">Go To Section 3</Link> | |
| </li> | |
| </ul> | |
| </nav> | |
| <article> | |
| <HashScroll hash="#hash-section-1"> | |
| <section>Section 1</section> | |
| </HashScroll> | |
| <HashScroll hash="#hash-section-2"> | |
| <section>Section 2</section> | |
| </HashScroll> | |
| <HashScroll hash="#hash-section-3"> | |
| <section>Section 3</section> | |
| </HashScroll> | |
| </article> | |
| </main> | |
| ); | |
| }; | |
| export default HashScrollPage; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment