feature/IO-3499-React-19: Remove redundant forward refs in favor of React 19 built in ref prop
This commit is contained in:
@@ -5,31 +5,27 @@ import { useTranslation } from "react-i18next";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import "./notification-center.styles.scss";
|
||||
import day from "../../utils/day.js";
|
||||
import { forwardRef, useEffect, useRef } from "react";
|
||||
import { useEffect, useRef } from "react";
|
||||
import { DateTimeFormat } from "../../utils/DateFormatter.jsx";
|
||||
|
||||
const { Text, Title } = Typography;
|
||||
|
||||
/**
|
||||
* Notification Center Component
|
||||
* @type {React.ForwardRefExoticComponent<React.PropsWithoutRef<{readonly visible?: *, readonly onClose?: *, readonly notifications?: *, readonly loading?: *, readonly showUnreadOnly?: *, readonly toggleUnreadOnly?: *, readonly markAllRead?: *, readonly loadMore?: *, readonly onNotificationClick?: *, readonly unreadCount?: *}> & React.RefAttributes<unknown>>}
|
||||
*/
|
||||
const NotificationCenterComponent = forwardRef(
|
||||
(
|
||||
{
|
||||
visible,
|
||||
notifications,
|
||||
loading,
|
||||
showUnreadOnly,
|
||||
toggleUnreadOnly,
|
||||
markAllRead,
|
||||
loadMore,
|
||||
onNotificationClick,
|
||||
unreadCount,
|
||||
isEmployee
|
||||
},
|
||||
ref
|
||||
) => {
|
||||
const NotificationCenterComponent = ({
|
||||
visible,
|
||||
notifications,
|
||||
loading,
|
||||
showUnreadOnly,
|
||||
toggleUnreadOnly,
|
||||
markAllRead,
|
||||
loadMore,
|
||||
onNotificationClick,
|
||||
unreadCount,
|
||||
isEmployee,
|
||||
ref
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const navigate = useNavigate();
|
||||
const virtuosoRef = useRef(null);
|
||||
@@ -127,8 +123,7 @@ const NotificationCenterComponent = forwardRef(
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
NotificationCenterComponent.displayName = "NotificationCenterComponent";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user