[WARN] Fix TypeScript/Svelte warnings from p04-content-patterns #18
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
TypeScript/Svelte Warnings to Fix
The following warnings were introduced during p04-content-patterns implementation:
Warning 1: DataTable - State Referenced Locally
File:
src/lib/components/common/DataTable.svelte:36Code:
Issue: The
dataprop is referenced directly in the options object, but Svelte 5 runes require reactive references to be inside closures or derived values.Fix Options:
datain a$derivedor function$effectto update table when data changesWarning 2: EmptyState - Deprecated svelte:component
File:
src/lib/components/common/EmptyState.svelte:23Code:
Fix: In Svelte 5, use dynamic components directly:
Or if dynamic switching is needed:
Warning 3-5: Navigation Accessibility (Pre-existing)
File:
src/lib/components/Navigation.svelteThese are pre-existing a11y warnings:
tabindex="0"on non-interactive elementsThese should be addressed separately as part of a11y improvements.
How to Reproduce
Environment