forked from hackforla/311-data
-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.jsx
33 lines (27 loc) · 743 Bytes
/
App.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import React, { useEffect } from 'react';
import PropTypes from 'proptypes';
import { HashRouter } from 'react-router-dom';
import { connect } from 'react-redux';
import { getMetadataRequest } from '@reducers/metadata';
import Header from '@components/Header';
import Footer from '@components/Footer';
import AppRoutes from './Routes';
function App({ getMetadata }) {
useEffect(() => {
getMetadata();
});
return (
<HashRouter>
<Header />
<AppRoutes />
<Footer />
</HashRouter>
);
}
const mapDispatchToProps = dispatch => ({
getMetadata: () => dispatch(getMetadataRequest()),
});
export default connect(null, mapDispatchToProps)(App);
App.propTypes = {
getMetadata: PropTypes.func.isRequired,
};