feat(client) ts-migrate AppMountNotifier Component (#42585)

* feat(client) Renamed AppMountNotifier.js to app-mount-notifier.tsx

* feat(client) ts-migrate AppMountNotifier Component

* remove type package from root

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
This commit is contained in:
ABHINAV SHARMA
2021-06-25 20:15:37 +05:30
committed by Mrugesh Mohapatra
parent f3d106dbff
commit 4f179ec8e1
3 changed files with 28 additions and 28 deletions

View File

@ -5,7 +5,7 @@ import { I18nextProvider } from 'react-i18next';
import i18n from './i18n/config';
import { createStore } from './src/redux/createStore';
import AppMountNotifier from './src/components/AppMountNotifier';
import AppMountNotifier from './src/components/app-mount-notifier';
import layoutSelector from './utils/gatsby/layoutSelector';
const store = createStore();

View File

@ -1,27 +0,0 @@
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 AppMountNotifier extends Component {
componentDidMount() {
return this.props.appMount();
}
render() {
return this.props.render();
}
}
AppMountNotifier.displayName = 'AppMountNotifier';
AppMountNotifier.propTypes = {
appMount: PropTypes.func.isRequired,
render: PropTypes.func.isRequired
};
export default connect(mapStateToProps, mapDispatchToProps)(AppMountNotifier);

View File

@ -0,0 +1,27 @@
import { Component, ReactNode } from 'react';
import { AnyAction, bindActionCreators, Dispatch } from 'redux';
import { connect } from 'react-redux';
import { appMount } from '../redux';
const mapStateToProps = () => ({});
const mapDispatchToProps = (dispatch: Dispatch<AnyAction>) =>
bindActionCreators({ appMount }, dispatch);
type AppMountNotifierProps = {
appMount: () => void;
render: () => ReactNode;
};
class AppMountNotifier extends Component<AppMountNotifierProps> {
static displayName = 'AppMountNotifier';
componentDidMount() {
return this.props.appMount();
}
render() {
return this.props.render();
}
}
export default connect(mapStateToProps, mapDispatchToProps)(AppMountNotifier);