mirror of
https://github.com/mattermost/mattermost-mobile.git
synced 2026-11-28 06:18:16 +00:00
* MM-34407 Use Avatars for Sidebar DMs * Update app/components/channel_icon.js Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com> * UI feedback * Align the private channel icon Co-authored-by: Joseph Baylon <joseph.baylon@mattermost.com>
19 lines
485 B
TypeScript
19 lines
485 B
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import {useRef, useEffect, EffectCallback, DependencyList} from 'react';
|
|
|
|
function useDidUpdate(callback: EffectCallback, deps?: DependencyList) {
|
|
const hasMount = useRef(false);
|
|
|
|
useEffect(() => {
|
|
if (hasMount.current) {
|
|
callback();
|
|
} else {
|
|
hasMount.current = true;
|
|
}
|
|
}, deps);
|
|
}
|
|
|
|
export default useDidUpdate;
|