Skip to content

Commit

Permalink
memoize notification
Browse files Browse the repository at this point in the history
  • Loading branch information
g-bar committed May 17, 2024
1 parent 05bc4f1 commit ec6ddfe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hooks/notifications.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useCallback, Key } from 'react';
import { useCallback, Key, useMemo } from 'react';
import { Placement } from '@/types/notifications';
import openNotification from '@/api/notifications';

Expand Down Expand Up @@ -79,5 +79,5 @@ export default function useNotification() {
[]
);

return { error, warning, success, info };
return useMemo(() => ({ error, warning, success, info }), [error, warning, success, info]);
}

0 comments on commit ec6ddfe

Please sign in to comment.