Ah, yes — that warning:
'props' is declared but its value is never read.ts(6133)
is a TypeScript warning, and it happens when you define a variable (props) but never actually use it in your code.
In your case:
const props = $props<{
data: {
form?: FormData;
};
}>();
...you're defining props and typing it, but if you're not referencing props.data.form or any other prop in your component, TypeScript will warn you that the variable is unused.
✅ How to Fix It
✅ Option 1: Use the Props (Recommended)
If you intend to use props.data.form, just make sure you reference it somewhere in your component. For example:
{#if props.data.form}
<p>Email: {props.data.form.email}</p>
{/if}
That way, TypeScript sees that you're using the props variable, and the warning goes away.
✅ Option 2: Remove Unused Typing If Not Needed
If you're not actually using any properties from data, and are only passing it down to Superforms or another component, then you don't need to type $props() so strictly.
You can simplify:
<script lang="ts">
import { $props } from 'svelte';
const props = $props<{
data: unknown;
}>();
let loading = $state(false);
</script>
Or even remove the typing entirely if you're not using the data prop inside this component:
<script lang="ts">
$props(); // Just call it, no need to store result
let loading = $state(false);
</script>
This tells Svelte "I know props exist, but I'm not using them directly here."
🧠 Bonus Tip: When You Pass Props Down
If you're using <Component data={data} /> and not accessing data inside the component yourself (e.g., you're just passing it to a child or a form), then you don’t need to access props.data at all in that file.
So just calling $props() without storing or using it is perfectly valid:
<script lang="ts">
$props(); // Required for prop forwarding to work
let loading = $state(false);
</script>
TypeScript won’t complain because you’re not assigning an unused variable.
✅ Summary
| Problem | Solution |
|---|
'props' is declared but its value is never read | Either use props.someProp in markup/logic or avoid storing the result of $props() |
| You're not using the props directly | Just call $props() without assigning it to a variable |
| You're passing props to children or forms | No need to destructure or log — just ensure $props() is called |
Let me know if you want help cleaning up the whole component with full Superforms integration!