Commit d338b7ea by David Kaltschmidt

Import and typescript fixups

parent 1e6e8912
......@@ -4,7 +4,7 @@ const INTERVAL = 150;
export default class ElapsedTime extends PureComponent<any, any> {
offset: number;
timer: NodeJS.Timer;
timer: number;
state = {
elapsed: 0,
......@@ -12,7 +12,7 @@ export default class ElapsedTime extends PureComponent<any, any> {
start() {
this.offset = Date.now();
this.timer = setInterval(this.tick, INTERVAL);
this.timer = window.setInterval(this.tick, INTERVAL);
}
tick = () => {
......
......@@ -21,8 +21,12 @@ export function reactContainer($route, $location, backendSrv: BackendSrv, dataso
restrict: 'E',
template: '',
link(scope, elem) {
let component = $route.current.locals.component.default;
let props = {
let component = $route.current.locals.component;
// Dynamic imports return whole module, need to extract default export
if (component.default) {
component = component.default;
}
const props = {
backendSrv: backendSrv,
datasourceSrv: datasourceSrv,
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment