Chore/React18: Update context types where needed (#57018)

pull/56659/head^2
kay delaney 3 years ago committed by GitHub
parent 0d9b321058
commit b1128e0b8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      packages/grafana-ui/src/components/Forms/Legacy/Select/Select.tsx
  2. 3
      public/app/features/dashboard/containers/DashboardPage.tsx
  3. 3
      public/app/features/dashboard/containers/SoloPanelPage.tsx
  4. 1
      public/app/plugins/panel/canvas/CanvasPanel.tsx
  5. 1
      public/app/plugins/panel/geomap/GeomapPanel.tsx
  6. 1
      public/app/plugins/panel/text/TextPanel.tsx

@ -52,6 +52,7 @@ export const MenuList = (props: MenuListProps) => {
);
};
export class Select<T> extends PureComponent<LegacySelectProps<T>> {
declare context: React.ContextType<typeof ThemeContext>;
static contextType = ThemeContext;
static defaultProps: Partial<LegacySelectProps<unknown>> = {
@ -248,7 +249,7 @@ export class AsyncSelect<T> extends PureComponent<AsyncProps<T>> {
placeholder={placeholder || 'Choose'}
//@ts-expect-error
styles={resetSelectStyles(this.context)}
loadingMessage={() => loadingMessage}
loadingMessage={loadingMessage}
noOptionsMessage={noOptionsMessage}
isDisabled={isDisabled}
isSearchable={isSearchable}

@ -8,7 +8,7 @@ import { config, locationService } from '@grafana/runtime';
import { Themeable2, withTheme2 } from '@grafana/ui';
import { notifyApp } from 'app/core/actions';
import { Page } from 'app/core/components/Page/Page';
import { GrafanaContext } from 'app/core/context/GrafanaContext';
import { GrafanaContext, GrafanaContextType } from 'app/core/context/GrafanaContext';
import { createErrorNotification } from 'app/core/copy/appNotification';
import { getKioskMode } from 'app/core/navigation/kiosk';
import { GrafanaRouteComponentProps } from 'app/core/navigation/types';
@ -98,6 +98,7 @@ export interface State {
}
export class UnthemedDashboardPage extends PureComponent<Props, State> {
declare context: GrafanaContextType;
static contextType = GrafanaContext;
private forceRouteReloadCounter = 0;

@ -2,7 +2,7 @@ import React, { Component } from 'react';
import { connect, ConnectedProps } from 'react-redux';
import AutoSizer from 'react-virtualized-auto-sizer';
import { GrafanaContext } from 'app/core/context/GrafanaContext';
import { GrafanaContext, GrafanaContextType } from 'app/core/context/GrafanaContext';
import { GrafanaRouteComponentProps } from 'app/core/navigation/types';
import { DashboardModel, PanelModel } from 'app/features/dashboard/state';
import { StoreState } from 'app/types';
@ -35,6 +35,7 @@ export interface State {
}
export class SoloPanelPage extends Component<Props, State> {
declare context: GrafanaContextType;
static contextType = GrafanaContext;
state: State = {

@ -35,6 +35,7 @@ let isInlineEditOpen = false;
export const activePanelSubject = new ReplaySubject<SelectionAction>(1);
export class CanvasPanel extends Component<Props, State> {
declare context: React.ContextType<typeof PanelContextRoot>;
static contextType = PanelContextRoot;
panelContext: PanelContext = {} as PanelContext;

@ -45,6 +45,7 @@ interface State extends OverlayProps {
}
export class GeomapPanel extends Component<Props, State> {
declare context: React.ContextType<typeof PanelContextRoot>;
static contextType = PanelContextRoot;
panelContext: PanelContext | undefined = undefined;
private subs = new Subscription();

@ -19,6 +19,7 @@ interface State {
}
export class TextPanel extends PureComponent<Props, State> {
declare context: React.ContextType<typeof ThemeContext>;
static contextType = ThemeContext;
constructor(props: Props) {

Loading…
Cancel
Save