aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorChristian Petersen <fnky@users.noreply.github.com>2019-05-05 22:19:37 +0300
committerJamie Kyle <me@thejameskyle.com>2019-05-05 22:19:37 +0300
commitec5a363f19f7b3264ed7ebbe11e628077ca73db7 (patch)
treeb67cea54ec3eb6543235d357a07fa6f46fdefbf7 /README.md
parent9ff30ea04616c066c3f439a3732a930c20d53248 (diff)
docs: fix counter example (#3)
Fixes the example where the increment function would subtract from `count` instead of add to it.
Diffstat (limited to 'README.md')
-rw-r--r--README.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/README.md b/README.md
index 9686534..66f4ff1 100644
--- a/README.md
+++ b/README.md
@@ -36,7 +36,7 @@ import { render } from "react-dom"
function useCounter() {
let [count, setCount] = useState(0)
let decrement = () => setCount(count - 1)
- let increment = () => setCount(count - 1)
+ let increment = () => setCount(count + 1)
return { count, decrement, increment }
}