Jesus sucks
This commit is contained in:
18
backend/frontend/node_modules/@restart/hooks/esm/usePrevious.d.ts
generated
vendored
Normal file
18
backend/frontend/node_modules/@restart/hooks/esm/usePrevious.d.ts
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Store the last of some value. Tracked via a `Ref` only updating it
|
||||
* after the component renders.
|
||||
*
|
||||
* Helpful if you need to compare a prop value to it's previous value during render.
|
||||
*
|
||||
* ```ts
|
||||
* function Component(props) {
|
||||
* const lastProps = usePrevious(props)
|
||||
*
|
||||
* if (lastProps.foo !== props.foo)
|
||||
* resetValueFromProps(props.foo)
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* @param value the value to track
|
||||
*/
|
||||
export default function usePrevious<T>(value: T): T | null;
|
||||
Reference in New Issue
Block a user