MCPcopy Create free account
hub / github.com/dailydotdev/apps / usePrevious

Function usePrevious

packages/shared/src/hooks/usePrevious.ts:3–9  ·  view source on GitHub ↗
(value: T)

Source from the content-addressed store, hash-verified

1import React, { useEffect } from 'react';
2
3export const usePrevious = <T>(value: T): T | undefined => {
4 const ref = React.useRef<T>();
5 useEffect(() => {
6 ref.current = value;
7 });
8 return ref.current;
9};

Callers 4

DropdownFunction · 0.90
setUpFunction · 0.85

Calls

no outgoing calls

Tested by 1

setUpFunction · 0.68