Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

Question about Svelte's reactive statements with typescript

$
0
0

I got the TS2695 error in this code.

<script lang="ts">  let count = 0;  $: count, (() => {    console.log(`TEST: ${count}`);  })();</script>

The error was the below.

Left side of comma operator is unused and has no side effects. ts(2695)

I thought the left side of the comma operator is the count variable, and it is used by console.log().

So, I didn't know how to handle this error. However, the code works well.

Please help me how to fix this error.


Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>