Jesus sucks
This commit is contained in:
23
backend/frontend/node_modules/@restart/hooks/cjs/useUpdateLayoutEffect.d.ts
generated
vendored
Normal file
23
backend/frontend/node_modules/@restart/hooks/cjs/useUpdateLayoutEffect.d.ts
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
import { EffectCallback, DependencyList } from 'react';
|
||||
/**
|
||||
* Runs a layout effect only when the dependencies have changed, skipping the
|
||||
* initial "on mount" run. Caution, if the dependency list never changes,
|
||||
* the effect is **never run**
|
||||
*
|
||||
* ```ts
|
||||
* const ref = useRef<HTMLInput>(null);
|
||||
*
|
||||
* // focuses an element only if the focus changes, and not on mount
|
||||
* useUpdateLayoutEffect(() => {
|
||||
* const element = ref.current?.children[focusedIdx] as HTMLElement
|
||||
*
|
||||
* element?.focus()
|
||||
*
|
||||
* }, [focusedIndex])
|
||||
* ```
|
||||
* @param effect An effect to run on mount
|
||||
*
|
||||
* @category effects
|
||||
*/
|
||||
declare function useUpdateLayoutEffect(fn: EffectCallback, deps: DependencyList): void;
|
||||
export default useUpdateLayoutEffect;
|
||||
Reference in New Issue
Block a user