Revert "Feature: Adds connectWithCleanup HOC (#19392)" (#19628)

This reverts commit 989f98efda.
This commit is contained in:
Hugo Häggmark
2019-10-04 05:24:47 -07:00
committed by GitHub
parent 989f98efda
commit 3e603cd88a
8 changed files with 48 additions and 250 deletions

View File

@@ -1,17 +1,17 @@
import React, { PureComponent } from 'react';
import { connect } from 'react-redux';
import { hot } from 'react-hot-loader';
import Page from 'app/core/components/Page/Page';
import { DeleteButton } from '@grafana/ui';
import { NavModel } from '@grafana/data';
import EmptyListCTA from 'app/core/components/EmptyListCTA/EmptyListCTA';
import { Team, OrgRole, StoreState } from 'app/types';
import { Team, OrgRole } from 'app/types';
import { loadTeams, deleteTeam, setSearchQuery } from './state/actions';
import { getSearchQuery, getTeams, getTeamsCount, isPermissionTeamAdmin } from './state/selectors';
import { getNavModel } from 'app/core/selectors/navModel';
import { FilterInput } from 'app/core/components/FilterInput/FilterInput';
import { config } from 'app/core/config';
import { contextSrv, User } from 'app/core/services/context_srv';
import { connectWithCleanUp } from '../../core/components/connectWithCleanUp';
export interface Props {
navModel: NavModel;
@@ -152,7 +152,7 @@ export class TeamList extends PureComponent<Props, any> {
}
}
function mapStateToProps(state: StoreState) {
function mapStateToProps(state: any) {
return {
navModel: getNavModel(state.navIndex, 'teams'),
teams: getTeams(state.teams),
@@ -170,4 +170,9 @@ const mapDispatchToProps = {
setSearchQuery,
};
export default hot(module)(connectWithCleanUp(mapStateToProps, mapDispatchToProps, state => state.teams)(TeamList));
export default hot(module)(
connect(
mapStateToProps,
mapDispatchToProps
)(TeamList)
);