From 69216ef267d98673e8a168510dba39b4400568e4 Mon Sep 17 00:00:00 2001 From: iamsahu <46891804+iamsahu@users.noreply.github.com> Date: Fri, 8 May 2020 01:54:26 +0530 Subject: [PATCH] Update hooks-state.md Have added more comments to the snippet of useState code for count for clear explanation --- content/docs/hooks-state.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/content/docs/hooks-state.md b/content/docs/hooks-state.md index 0b4d15b65e7..2498c4f170a 100644 --- a/content/docs/hooks-state.md +++ b/content/docs/hooks-state.md @@ -15,11 +15,13 @@ import React, { useState } from 'react'; function Example() { // Declare a new state variable, which we'll call "count" + // and a function "setCount" which we will call to update "count const [count, setCount] = useState(0); return (
You clicked {count} times
+ //Over here we are calling the function setCount and passing it the value we want it to assign to "count"