SolidJSS
SolidJSโ€ข3y agoโ€ข
1 reply
bigmistqke

createMemo with `{equals: false}` not reactive

I am wondering if this is a bug or not:

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

  const arr: number[] = [];
  const memo = createMemo(() => ((arr[0] = count()), arr), { equals: false });
  createEffect(() => console.log(memo()))
  
  return (
    <button type="button" onClick={increment}>
      {memo().join(', ')}
    </button>
  );
}


The effect nor the jsx gets updated. Is this expected behavior?

playground
Quickly discover what the solid compiler will generate from your JSX template
Was this page helpful?