-
-
Save marshallmurphy/d8f1fa6756d13cafed1ca9c14dfdd3d3 to your computer and use it in GitHub Desktop.
This file contains 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
// App.js | |
import React, { lazy, Suspense } from 'react'; | |
import { Router } from "@reach/router"; | |
import Main from './Main'; | |
// import SplitThis from './SplitThis'; | |
import './App.css'; | |
// lazy load the component | |
const SplitThis = lazy(() => import('./SplitThis')); | |
const App = () => ( | |
<div className="App"> | |
<Suspense fallback={ <h1>Loading route...</h1>}> | |
<Router> | |
<Main default path="/" /> | |
<SplitThis path="/split" /> | |
</Router> | |
</Suspense> | |
</div> | |
); | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment