Outlook_Addin_LLM/node_modules/@fluentui/react-hooks/lib/useConst.d.ts

13 lines
686 B
TypeScript

/**
* Hook to initialize and return a constant value. Unlike `React.useMemo`, this is guaranteed to
* always return the same value (and if the initializer is a function, only call it once).
* This is similar to setting a private member in a class constructor.
*
* If the value should ever change based on dependencies, use `React.useMemo` instead.
*
* @param initialValue - Initial value, or function to get the initial value. Similar to `useState`,
* only the value/function passed in the first time this is called is respected.
* @returns The value. The identity of this value will always be the same.
*/
export declare function useConst<T>(initialValue: T | (() => T)): T;