From a0ffbcd1c6fbe22958f2f215f512850ba7c1d491 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Katarzyna=20Jastrze=CC=A8bska?= Date: Thu, 12 Sep 2019 12:55:50 +0200 Subject: [PATCH] update docs with function argument --- content/docs/hooks-state.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/content/docs/hooks-state.md b/content/docs/hooks-state.md index 0b4d15b65e7..be545d68dab 100644 --- a/content/docs/hooks-state.md +++ b/content/docs/hooks-state.md @@ -187,6 +187,13 @@ In a function, we already have `setCount` and `count` as variables so we don't n ``` +You can pass value as an argument to `setCount` or `function` with return statement: + +```js{1} + setCount(1); + setCount(previousValue => previousValue + 2); +``` + ## Recap {#recap} Let's now **recap what we learned line by line** and check our understanding.