You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
📋 Description of content that is out-of-date or incorrect
I found it pretty confusing that on the final example of this page, what should be a simple counter example, uses a form of passing a function to setCount which is not explained anywhere prior being used in the example:
functionCounter(){const[count,setCount]=createSignal(0);constincrement=()=>setCount((prev)=>prev+1);// this line confused mereturn(<div><span>Count: {count()}</span>{/* Updates when `count` changes */}<buttontype="button"onClick={increment}>
Increment
</button></div>);}
Reading the docs from createSignal I can see that there is a form of the setter which is a callback function however even on the createSignal doc that syntax for the setter is not explained very explicitly.
🖥️ Reproduction in StackBlitz (if reporting incorrect content or code samples)
n/a
The text was updated successfully, but these errors were encountered:
📚 Subject area/topic
/concepts/signals.mdx
📋 Page(s) affected (or suggested, for new content)
https://docs.solidjs.com/concepts/signals
https://docs.solidjs.com/reference/basic-reactivity/create-signal
📋 Description of content that is out-of-date or incorrect
I found it pretty confusing that on the final example of this page, what should be a simple counter example, uses a form of passing a function to
setCount
which is not explained anywhere prior being used in the example:Reading the docs from
createSignal
I can see that there is a form of the setter which is a callback function however even on thecreateSignal
doc that syntax for the setter is not explained very explicitly.🖥️ Reproduction in StackBlitz (if reporting incorrect content or code samples)
n/a
The text was updated successfully, but these errors were encountered: