mirror of
https://github.com/grafana/grafana.git
synced 2024-11-24 09:50:29 -06:00
Chore/React18: Update context types where needed (#57018)
This commit is contained in:
parent
0d9b321058
commit
b1128e0b8c
@ -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…
Reference in New Issue
Block a user