MCPcopy Create free account
hub / github.com/coolvasanth/reactjs_interview_preparation / incrementCount

Function incrementCount

src/HardQuestions/Exercise5.js:6–13  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4 const [state, setState] = useState({ count: 0 });
5
6 const incrementCount = () => {
7 setState(prevState => ({
8 count: prevState.count + 1
9 }));
10 setState(prevState => ({
11 count: prevState.count + 1
12 }));
13 };
14
15 return (
16 <div>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected