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

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;