Created
August 9, 2021 08:09
-
-
Save codewithbernard/abc6c833cf7fde0f56ba2f7bfe45904c 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