mattermost-mobile/app/hooks/initial_value.ts
Daniel Espino García cff12f7182
Enable exhaustive deps in the repo (#9508)
* Enable exhaustive deps in the repo

* Add tests for the new hooks

* Update claude.md

* Remove pre-commit overwrite
2026-02-18 11:56:16 +01:00

12 lines
375 B
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {useMemo} from 'react';
function useInitialValue<T>(factory: () => T) {
// We only want the initial value, no updates.
// eslint-disable-next-line react-hooks/exhaustive-deps
return useMemo<T>(factory, []);
}
export default useInitialValue;