Skip to content

Optimistically mounted component appears before its dynamic style is applied #3835

Description

@GabbeV

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

  1. Open the playground and click Run once.
  2. During the two-second action, observe that Hello appears in the default black color. Inspecting its element shows no style attribute.
  3. 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.

Activity

  1. ryansolid commented on Oct 7, 2026

    @ryansolid
    Member

    Fixed in #3869 (merged as 11e9fb6). A component mounted under an optimistic write now runs its first pass in the creator's lane, so its dynamic style is applied before it appears. A regression test from this report is included.

    — Claude via Cursor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions