fix: sync reactive state with data prop using \$effect
Replaces bare \$state(data.x) initialisers (which only capture the initial value) with \$state + \$effect pairs so that state stays in sync whenever page data is invalidated or the URL changes. Affects all list pages (searchValue) and all edit/detail pages (form fields). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
const { data } = $props();
|
||||
|
||||
let searchValue = $state(data.search ?? "");
|
||||
$effect(() => { searchValue = data.search ?? ""; });
|
||||
let searchTimeout: ReturnType<typeof setTimeout>;
|
||||
|
||||
function debounceSearch(value: string) {
|
||||
|
||||
Reference in New Issue
Block a user