Commit d338b7ea by David Kaltschmidt

Import and typescript fixups

parent 1e6e8912
...@@ -4,7 +4,7 @@ const INTERVAL = 150; ...@@ -4,7 +4,7 @@ const INTERVAL = 150;
export default class ElapsedTime extends PureComponent<any, any> { export default class ElapsedTime extends PureComponent<any, any> {
offset: number; offset: number;
timer: NodeJS.Timer; timer: number;
state = { state = {
elapsed: 0, elapsed: 0,
...@@ -12,7 +12,7 @@ export default class ElapsedTime extends PureComponent<any, any> { ...@@ -12,7 +12,7 @@ export default class ElapsedTime extends PureComponent<any, any> {
start() { start() {
this.offset = Date.now(); this.offset = Date.now();
this.timer = setInterval(this.tick, INTERVAL); this.timer = window.setInterval(this.tick, INTERVAL);
} }
tick = () => { tick = () => {
......
...@@ -21,8 +21,12 @@ export function reactContainer($route, $location, backendSrv: BackendSrv, dataso ...@@ -21,8 +21,12 @@ export function reactContainer($route, $location, backendSrv: BackendSrv, dataso
restrict: 'E', restrict: 'E',
template: '', template: '',
link(scope, elem) { link(scope, elem) {
let component = $route.current.locals.component.default; let component = $route.current.locals.component;
let props = { // Dynamic imports return whole module, need to extract default export
if (component.default) {
component = component.default;
}
const props = {
backendSrv: backendSrv, backendSrv: backendSrv,
datasourceSrv: datasourceSrv, 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