diff options
author | Christian Petersen <fnky@users.noreply.github.com> | 2019-05-05 22:19:37 +0300 |
---|---|---|
committer | Jamie Kyle <me@thejameskyle.com> | 2019-05-05 22:19:37 +0300 |
commit | ec5a363f19f7b3264ed7ebbe11e628077ca73db7 (patch) | |
tree | b67cea54ec3eb6543235d357a07fa6f46fdefbf7 | |
parent | 9ff30ea04616c066c3f439a3732a930c20d53248 (diff) |
docs: fix counter example (#3)
Fixes the example where the increment function would subtract from `count` instead of add to it.
-rw-r--r-- | README.md | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 } } |