Optimistically mounted component appears before its dynamic style is applied
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 半天
- 新手友好度
- 65/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript, typescript
- 领域
- frontend
调研方向
Start from the optimistic mounting and memo implementation in the rendering pipeline. The issue involves createMemo and style application during optimistic renders. Use the playground reproduction to verify the behavior. The fix should ensure the component either waits for styles before mounting or uses the committed signal value for the initial render.
由索引模型根据 Issue 内容生成。
描述
Describe the bug
An optimistically mounted component reveals its static text before applying its dynamic style.
The component returns a memo containing an element whose color is always either red or blue. Its style and an inner conditional read the same non-optimistic signal. While an action holds that signal's update, clicking Run reveals <div>Hello</div> with no style attribute. After two seconds it becomes <div style="color: blue;">Hello world</div>.
The issue is the unstyled intermediate element, not that the blue update waits for the action.
Your Example Website or App
https://s.olid.uk/id/cu5JVqDbSkWlmoERReb30Q
Steps to Reproduce the Bug or Issue
- Open the playground and click Run once.
- During the two-second action, observe that Hello appears in the default black color. Inspecting its element shows no
styleattribute. - When the action finishes, the text becomes Hello world and the blue style is applied.
Expected behavior
Either keep the child held until it can render consistently, or reveal it using the committed signal value (false, so red). Revealing the element without either declared color is inconsistent.
Screenshots or Videos
No response
Platform
- OS: Linux (WSL)
- Browser: Chromium 153.0.8010.12
- Solid: preview build
3ab71b0(solid-js,@solidjs/web, and@solidjs/signals)
Additional context
Removing the component's createMemo wrapper or replacing its inner conditional text with static text avoids the unstyled intermediate element. The repro uses only signals, an optimistic signal, an action, and a real timer; Tailwind is disabled.
- 主要语言
- TypeScript
- 星标
- 36.1k
- 派生
- 1.1k
- 平均合并
- 11 小时 42 分钟
- 30 天内合并 PR
- 326
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
solidjs/solid 的其他 Issue
-
[2.0 next, regressed after rc.13] Async-generator action times out on its authoritative live echo未关闭
难度 3/5 1-2 天 新手友好度 55/100
维护者通常 1 天内回复
-
难度 3/5 半天 新手友好度 75/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 64/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 55/100
维护者通常 1 天内回复
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 82/100
siyuan-note/siyuan#20313 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 92/100
alunduil/projects-v2-sync#14 ·
-
Service process inherits the caller's cwd at first use, holding that folder open on Windows (EBUSY)未关闭
难度 2/5 1-3 小时 新手友好度 76/100
-
难度 2/5 1-3 小时 新手友好度 82/100
-
DevTools page styles leak into the host app in development可能已有人在做 @onmax 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
nuxt-modules/better-auth#567 · 1 条评论 ·
维护者通常 1 天内回复