MCPcopy Create free account
hub / github.com/Klerith/react-hooks / increment

Function increment

src/hooks/useCounter.js:8–10  ·  view source on GitHub ↗
( value = 1 )

Source from the content-addressed store, hash-verified

6 const [ counter, setCounter ] = useState( initialValue )
7
8 const increment = ( value = 1 ) => {
9 setCounter( counter + value );
10 }
11
12 const decrement = ( value = 1 ) => {
13 // if ( counter === 0 ) return;

Callers 6

MultipleCustomHooksFunction · 0.85
CounterWithCustomHookFunction · 0.85
LayoutFunction · 0.85
ShowIncrement.jsxFile · 0.85
MemoHookFunction · 0.85
MemorizeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected