Skip to content

<Title> warning when it's not single string #64

Open

Description

@ttetlov

When <Title> component children is not a single unit like <Title>{title()} | Brand</Title> it creates warning:

computations created outside a createRoot or render will never be disposed

export default function About() {
  const title = createMemo(() => "About");

  return (
    <main>
      <Title>{title()} | Brand</Title>
      <h1>About</h1>
      <Counter />
    </main>
  );
}

Does not create warning:

export default function About() {
  const title = createMemo(() => "About");

  return (
    <main>
      <Title>{title() + " | Brand"}</Title>
      <h1>About</h1>
      <Counter />
    </main>
  );
}

For testing and example I used default "bare" project from npm create solid and happens when navigating away from page using it.

Activity

  1. changed the title [-]<Title>[/-] [+]<Title> warning when it's not single string[/+] on Aug 7, 2025
  2. samerset-rmn commented on Jun 23, 2026

    @samerset-rmn

    Same issue here. Rendering the title as a single string fixes it, but this seems more like a bug than intended behavior, since the documentation doesn't mention it.

    export const Game = (props: { name: string}) => {
      return (
        <main>
          {/* Workaround, <Title>Game {props.name}</Title> causes the warning */}
          <Title>{`Game ${props.name}`}</Title>
          <div>content</div>
        </main>
      )
    }
  3. AFatNiBBa commented on Aug 7, 2026

    @AFatNiBBa
    Contributor

    By looking at the code, it looks like this issue has been fixed, but the fix has not been released on NPM, was this done on purpose?

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