Just starting out with Svelte and I'm trying to figure out how to pass a number value as a prop. Here's the code I have so far:
<script lang="ts">
import Infobox from "./Infobox.svelte";
</script>
<Infobox classCount=2 taskCount=6 />
<style></style>
<script lang="ts">
export let taskCount: number;
export let classCount: number;
</script>
<section>
<div>{taskCount} Tasks</div>
<div>Class {classCount}</div>
</section>
<style></style>
Unfortunately, I've been struggling to pass the prop as a number and it seems to only accept strings like
<Infobox classCount="2" taskCount="6" />
.
I'm also incorporating typescript into my project.
Any help would be greatly appreciated :)