mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 04:22:13 +08:00
Sandbox: Fix react class components stale state (#70572)
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
import React from 'react';
|
||||
|
||||
import { SandboxedPluginObject } from './types';
|
||||
|
||||
export function isSandboxedPluginObject(value: unknown): value is SandboxedPluginObject {
|
||||
@ -7,3 +9,7 @@ export function isSandboxedPluginObject(value: unknown): value is SandboxedPlugi
|
||||
export function assertNever(x: never): never {
|
||||
throw new Error(`Unexpected object: ${x}. This should never happen.`);
|
||||
}
|
||||
|
||||
export function isReactClassComponent(obj: unknown): obj is React.Component {
|
||||
return obj instanceof React.Component;
|
||||
}
|
||||
|
Reference in New Issue
Block a user