Move inline function to a classic style function in routes
This commit is contained in:
+5
-1
@@ -8,6 +8,10 @@ import CommonPage from "./pages/CommonPage";
|
||||
import JsonLD from "./components/JsonLD";
|
||||
import "./index.scss";
|
||||
|
||||
const renderFrontPage = (props): JSX.Element => {
|
||||
return <CommonPage page={FrontPage} {...props} />;
|
||||
};
|
||||
|
||||
const Routes = () => (
|
||||
<Fragment>
|
||||
<Helmet>
|
||||
@@ -22,7 +26,7 @@ const Routes = () => (
|
||||
"url": "https://sik.ayy.fi",
|
||||
}} />
|
||||
<Switch>
|
||||
<Route exact path="/" render={(props) => <CommonPage page={FrontPage} {...props} />} />
|
||||
<Route exact path="/" render={renderFrontPage} />
|
||||
<Route component={NotFoundPage} />
|
||||
</Switch>
|
||||
</Fragment>
|
||||
|
||||
Reference in New Issue
Block a user