From ec5a363f19f7b3264ed7ebbe11e628077ca73db7 Mon Sep 17 00:00:00 2001 From: Christian Petersen Date: Sun, 5 May 2019 21:19:37 +0200 Subject: docs: fix counter example (#3) Fixes the example where the increment function would subtract from `count` instead of add to it. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.md') 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 } } -- cgit v1.2.3