Created
August 21, 2021 19:12
-
-
Save charisTheo/7900f9082a252ca68651f8e5e06daacc 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, { useState } from 'react' | |
| const NavMenu = React.lazy(() => import('./NavMenu')) | |
| function Header() { | |
| const [showMenu, setShowMenu] = useState(false) | |
| return ( | |
| <div> | |
| <React.Suspense fallback={<p>Loading...</p>}> | |
| {showMenu && <NavMenu />} | |
| </React.Suspense> | |
| </div> | |
| )} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment