Files
freeCodeCamp/client/src/components/AppMountNotifier.js
2018-09-03 17:47:48 +05:30

31 lines
714 B
JavaScript

import { Component } from 'react';
import PropTypes from 'prop-types';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { appMount } from '../redux';
const mapStateToProps = () => ({});
const mapDispatchToProps = dispatch =>
bindActionCreators({ appMount }, dispatch);
class AppMountNotifer extends Component {
componentDidMount() {
return this.props.appMount();
}
render() {
return this.props.render();
}
}
AppMountNotifer.displayName = 'AppMountNotifier';
AppMountNotifer.propTypes = {
appMount: PropTypes.func.isRequired,
render: PropTypes.func.isRequired
};
export default connect(
mapStateToProps,
mapDispatchToProps
)(AppMountNotifer);