Skip to content

<Repeat/> does not update when its times.prop changes #785

Open
@bigmistqke

Description

@bigmistqke

Describe the bug

function Counter() {
  const [count, setCount] = createSignal(2);
  const increment = () => setCount((count) => count + 1);
  const decrement = () => setCount((count) => count - 1);

  return (
    <>
      <button onClick={increment}>increment</button>
      <button onClick={decrement}>decrement</button>
      <Repeat times={count()}>{() => "hallo"}</Repeat>
    </>
  );
}

steps to reproduce bug:

  • initial render: hallohallo
  • press decrement: stays hallohallo
  • press increment: stays hallohallo
  • only when times becomes 0 it will render empty

I was able to narrow the bug to the usage of createMemo in <Repeat/>

Minimal Reproduction Link

https://playground.solidjs.com/anonymous/6c6feac1-bd0d-41f1-b6ec-61bca51182e3

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