From d4d0a38ccbe8778e27a80d31db7e94a4f9df4c68 Mon Sep 17 00:00:00 2001 From: Lukas Reining Date: Wed, 22 Nov 2023 18:50:42 +0100 Subject: [PATCH] fix: ts error regarding NodeJS.Timer in frontend (#254) ## This PR @toddbaert as said, this fixes the typescript error where Node.JS Timers are returned from setInterval. ### Related Issues ### Notes ### Follow-up Tasks ### How to test Signed-off-by: Todd Baert --- packages/ui/src/app/demos/fib3r/calculator.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/ui/src/app/demos/fib3r/calculator.tsx b/packages/ui/src/app/demos/fib3r/calculator.tsx index 1d33e5a9..b5420045 100644 --- a/packages/ui/src/app/demos/fib3r/calculator.tsx +++ b/packages/ui/src/app/demos/fib3r/calculator.tsx @@ -10,7 +10,7 @@ export class Calculator extends React.Component< }, { millis: string | number; running: boolean; n: number } > { - private interval?: NodeJS.Timer = undefined; + private interval?: number = undefined; private start = 0; constructor(props: { @@ -159,7 +159,7 @@ export class Calculator extends React.Component< private stopTimer() { if (this.interval) { - clearInterval(this.interval); + window.clearInterval(this.interval); } this.setState({ running: false, @@ -173,7 +173,7 @@ export class Calculator extends React.Component< this.setState({ millis: 0, }); - this.interval = setInterval(() => { + this.interval = window.setInterval(() => { this.setState({ millis: new Date().getTime() - this.start, running: true,