Move inline function to a classic style function in routes

This commit is contained in:
Jan Tuomi
2018-11-19 18:11:08 +02:00
parent 322e193ef2
commit 747cf99323
+5 -1
View File
@@ -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>