MCPcopy Create free account
hub / github.com/WardAnalytics/WardGraph / Delayed

Function Delayed

src/components/common/Delayed.tsx:14–25  ·  view source on GitHub ↗
({ children, waitBeforeShow = 500 }: Props)

Source from the content-addressed store, hash-verified

12 */
13
14const Delayed = ({ children, waitBeforeShow = 500 }: Props) => {
15 const [isShown, setIsShown] = useState(false);
16
17 useEffect(() => {
18 const timer = setTimeout(() => {
19 setIsShown(true);
20 }, waitBeforeShow);
21 return () => clearTimeout(timer);
22 }, [waitBeforeShow]);
23
24 return isShown ? children : null;
25};
26
27export default Delayed;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected