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>
);
}
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
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
1 Reply
bigmistqke
bigmistqkeOP11mo ago
o nvm, memo-options is third parameter of createMemo
Want results from more Discord servers?
Add your server