MCPcopy
hub / github.com/DavidHDev/react-bits / useForceRerender

Function useForceRerender

src/hooks/useForceRerender.js:3–11  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1import { useState, useCallback } from 'react';
2
3const useForceRerender = () => {
4 const [key, setKey] = useState(0);
5
6 const forceRerender = useCallback(() => {
7 setKey(prevKey => prevKey + 1);
8 }, []);
9
10 return [key, forceRerender];
11};
12
13export default useForceRerender;

Callers 15

CurvedLoopDemoFunction · 0.85
TextCursorDemoFunction · 0.85
ShuffleDemoFunction · 0.85
SplitTextDemoFunction · 0.85
BlurTextDemoFunction · 0.85
ScrollFloatDemoFunction · 0.85
GlitchTextDemoFunction · 0.85
DecryptedTextDemoFunction · 0.85
RotatingTextDemoFunction · 0.85
TextTypeDemoFunction · 0.85
CountUpDemoFunction · 0.85
ScrollRevealDemoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected