Last active
September 13, 2020 10:28
-
-
Save srezasm/8f4b5dc5f5c7d1e362b83a503df3dc12 to your computer and use it in GitHub Desktop.
Revisions
-
srezasm revised this gist
Sep 13, 2020 . 2 changed files with 16 additions and 27 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,28 +1,19 @@ import React from "react"; import { BrowserRouter, Route, Link, Switch } from "react-router-dom"; const AskPage = React.lazy(() => import("./AskPage")); const App = () => { return ( <BrowserRouter> <Link to="/ask">AskPage</Link> <Route exact path="/ask"> <React.Suspense fallback={<div style={{ marginTop: "100px", textAlign: "center" }}>Loading...</div>}> <AskPage /> </React.Suspense> </Route> </BrowserRouter> ); }; export default App; 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,5 @@ import React from "react"; export const AskPage = () => <h1> This is AskPage </h1>; export default AskPage; -
srezasm created this gist
Sep 13, 2020 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ import React from 'react'; import { BrowserRouter, Route, Link } from 'react-router-dom'; const AskPage = React.lazy(() => import('./AskPage')); const App = () => { return ( <React.Fragment> <h1>Hello! this is HomePage</h1> <Link to="/ask">AskPage</Link> <BrowserRouter> <Route path="/ask"> <React.Suspense fallback={ <div style={{ marginTop: '100px', textAlign: 'center' }}> Loading... </div> } > <AskPage /> </React.Suspense> </Route> </BrowserRouter> </React.Fragment> ); }; export default App; 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ import React from 'react'; export const AskPage = () => { return <h1> This is AskPage </h1>; }; export default AskPage;