Centralize all redux types into one place, add overrides for the connect, useSelector and useDispatch functions

This commit is contained in:
ErickSkrauch
2020-07-22 13:01:12 +03:00
parent 96e74cf9bb
commit 5a9c54002d
44 changed files with 199 additions and 141 deletions

View File

@@ -1,10 +1,10 @@
import React, { MouseEventHandler } from 'react';
import { connect } from 'react-redux';
import { defineMessages, FormattedMessage as Message } from 'react-intl';
import { Helmet } from 'react-helmet-async';
import { connect } from 'app/functions';
import { Button } from 'app/components/ui/form';
import copy from 'app/services/copy';
import { RootState } from 'app/reducers';
import styles from './finish.scss';
@@ -104,7 +104,7 @@ class Finish extends React.Component<Props> {
};
}
export default connect(({ auth }: RootState) => {
export default connect(({ auth }) => {
if (!auth || !auth.client || !auth.oauth) {
throw new Error('Can not connect Finish component. No auth data in state');
}