SolidJSS
SolidJSโ€ข3y agoโ€ข
12 replies
Evert

How can this incredibly simple piece of code lead to "Maximum call stack size exceeded" ?

The entire code for this demo is here:
https://playground.solidjs.com/anonymous/7ec72a47-1bb4-4e9f-bf1d-3103d3d2c2d0

I just adapted it from one of the tutorial pages. The culprit is one line, as far as I can tell:

createEffect(() => [0, 359].includes(num()) && setDir(dir() * -1));

I just don't understand how that one line creates a stack overflow. Can anybody enlighten me and maybe offer an alternative? Any help would be much appreciates. ๐Ÿ™
Quickly discover what the solid compiler will generate from your JSX template
Was this page helpful?