[svelte] Why can't I bind to a `createQuery` result?
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- frontend
调研方向
从链接的 Svelte playground 开始,使用报告中的 Player.svelte、FormPlayers.svelte 和 FormPlayerSkill.svelte 示例重现该警告。结合 $derived 和 $bindable 的行为阅读 Svelte 关于 binding_property_non_reactive 的指导,然后比较 TanStack Svelte Query 的结果是如何暴露的。完成的标准是确定此绑定为何不是响应式的,并记录或确认受支持的行为。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
Using Svelte (v5.42.3) and Svelte Kit (v2.48.2) and @tanstack/svelte-query (v6.0.3).
If I have the component Player.svelte:
<script lang="ts">
import { createQuery } from '@tanstack/svelte-query';
const playerStore = createQuery(() => ({
queryKey: "key",
queryFn: playerById(page.params.player_id),
}));
let { data: player } = $derived(playerStore);
</script>
<FormPlayers bind:player={player} />
and FormPlayers.svelte:
<script lang="ts">
type Props = {
player: Player;
};
let {
player = $bindable(),
}: Props = $props();
</script>
{#each player.skills as skill, index (skill.id)}
<FormPlayerSkill bind:skill={player.skills[index]} />
{/each}
and FormPlayerSkill.svelte:
<script lang="ts">
type Props = {
skill: PlayerSkillInput;
};
let {
skill = $bindable()
}: Props = $props();
</script>
<Date bind:date={skill.date} />
I get the error:
FormPlayers.svelte:77 [svelte] binding_property_non_reactive
`bind:skill={player.skills[index]}` (src/routes/players/FormPlayers.svelte:40:4) is binding to a non-reactive property
https://svelte.dev/e/binding_property_non_reactive
Why? Isn't the let { data: player } = $derived(playerStore) assignable / bindable / editable / "Sveltable"?
Your minimal, reproducible example
I'll post ASAP (it's not easy).
Tanstack Query adapter
svelte-query
TanStack Query version
6.0.3
TypeScript version
5.9.3
- 主要语言
- TypeScript
- 星标
- 50.4k
- 派生
- 4.2k
- 平均合并
- 11 小时 33 分钟
- 30 天内合并 PR
- 421
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TanStack/query 的其他 Issue
-
solid-query: STRICT_READ_UNTRACKED on Solid 2 — client()/options() read in component body (useMutation, useBaseQuery)可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
TanStack/query#11358 · 2 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
solid-query: switching the queryClient accessor strands the new client's cache (subscription stays on the old observer)可能已有人在做 @MaNaN1803 于 74 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
TanStack/query#11106 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 45/100
维护者通常 1 天内回复
-
setQueryData: NoInfer loses discriminated-union members when spreading a narrowed updater value可能已有人在做 @iosayin 于 1 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 55/100
维护者通常 1 天内回复
-
setQueryData updater loses discriminated-union fields when spreading inferred NoInfer data可能已有人在做 @boriskozak 于 1 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 68/100
TanStack/query#11794 · 1 条评论 ·
维护者通常 1 天内回复
相似的 Issue
-
perf(core): getComments() runs the approved count and the comment list as two sequential queries未关闭area/core bot:bug bot:working
难度 2/5 1-3 小时 新手友好度 76/100
emdash-cms/emdash#3905 · 2 条评论 ·
维护者通常 1 天内回复
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
难度 1/5 1 小时以内 新手友好度 90/100
lingdojo/kana-dojo#31728 · 1 条评论 · 5 个 reaction ·
维护者通常 1 天内回复
-
selective-claw: freshTailTurns=0 keeps ALL turns verbatim and summarizes none (slice(-0) === slice(0))可能已有人在做 @zjncs 今天认领。 未关闭component:tokenless
难度 2/5 1-3 小时 新手友好度 80/100
agentic-os-org/ANOLISA#6112 · 1 条评论 ·
维护者通常 1 天内回复
-
bug needs triage
难度 2/5 1-3 小时 新手友好度 75/100
rjsf-team/react-jsonschema-form#5439 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复