Files
starface-outlook-sync-addin/node_modules/@fluentui/react-hooks/lib/useConstCallback.d.ts
T
Stefan Hacker 37ad745546 first commit
2026-04-03 09:38:48 +02:00

12 lines
704 B
TypeScript

/**
* @deprecated Deprecated due to potential for misuse. Generally, use `React.useCallback` instead.
* If you need a callback reference that never changes, consider `useEventCallback`.
*
* This hook was intended for creating callbacks which have no dependencies, and therefore never
* need to change. It works fine if everyone using it is extremely mindful of how closures work,
* but that's not a safe assumption--so in practice, usage of this hook tends to result in bugs
* like unintentionally capturing the first value of a prop and not respecting updates (when
* updates should be respected).
*/
export declare function useConstCallback<T extends (...args: any[]) => any>(callback: T): T;