diff --git a/src/pages/index.js b/src/pages/index.js index a9c36e2..a215ea4 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -39,36 +39,44 @@ const readURLHash = (location, defaultSyntax) => { } }; -export const IndexPage = ({ - location, - data: { site: { siteMetadata } } -}) => <> - - - - You need JavaScript to use Regexper. - If you have concerns regarding the use of tracking code on Regexper, - please see the Privacy Policy. - - - ->; - -IndexPage.propTypes = { - location: PropTypes.object, - data: PropTypes.shape({ - site: PropTypes.shape({ - siteMetadata: PropTypes.shape({ - defaultSyntax: PropTypes.string, - syntaxList: PropTypes.arrayOf(PropTypes.shape({ - id: PropTypes.string, - label: PropTypes.string - })) +class IndexPage extends React.PureComponent { + static propTypes = { + location: PropTypes.object, + data: PropTypes.shape({ + site: PropTypes.shape({ + siteMetadata: PropTypes.shape({ + defaultSyntax: PropTypes.string, + syntaxList: PropTypes.arrayOf(PropTypes.shape({ + id: PropTypes.string, + label: PropTypes.string + })) + }) }) }) - }) -}; + } + + render() { + const { + location, + data: { site: { siteMetadata } } + } = this.props; + + return <> + + + + You need JavaScript to use Regexper. + + If you have concerns regarding the use of tracking code on Regexper, + please see the Privacy Policy. + + + + + >; + } +} export default IndexPage; diff --git a/src/pages/index.test.js b/src/pages/index.test.js index e2f6f9f..6c909f1 100644 --- a/src/pages/index.test.js +++ b/src/pages/index.test.js @@ -1,7 +1,7 @@ import React from 'react'; import { shallow } from 'enzyme'; -import { IndexPage } from 'pages/index'; +import IndexPage from 'pages/index'; const queryResult = { site: {
You need JavaScript to use Regexper.
If you have concerns regarding the use of tracking code on Regexper, - please see the Privacy Policy.
+ If you have concerns regarding the use of tracking code on Regexper, + please see the Privacy Policy. +