We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 08f03cd commit c37829fCopy full SHA for c37829f
1 file changed
src/routes/reference/basic-reactivity/create-signal.mdx
@@ -99,7 +99,25 @@ Returns a tuple `[getter, setter]` where:
99
- **getter**: An accessor function that returns the current value and tracks dependencies when called within a reactive context
100
- **setter**: A function that updates the signal's value and notifies all dependent computations
101
102
-## Usage
+## Examples
103
+
104
+### Basic Usage
105
106
+```tsx
107
+import { createSignal } from "solid-js";
108
109
+function Counter() {
110
+ const [count, setCount] = createSignal(0);
111
112
+ return (
113
+ <div>
114
+ <button onClick={() => setCount(count() + 1)}>+</button>
115
+ <span>{count()}</span>
116
+ </div>
117
+ );
118
+}
119
120
+```
121
122
## How It Works
123
0 commit comments