Skip to content

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

@ttetlov

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.

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