From 71a49c30ffc83f24ab26f12a9dd9efd1a3af5380 Mon Sep 17 00:00:00 2001 From: Florian Duros Date: Wed, 3 Apr 2024 16:28:02 +0200 Subject: [PATCH] Fix release announcement for react 17 --- .../ReleaseAnnouncement/ReleaseAnnouncement.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/components/ReleaseAnnouncement/ReleaseAnnouncement.tsx b/src/components/ReleaseAnnouncement/ReleaseAnnouncement.tsx index 42c145a1..113d6b32 100644 --- a/src/components/ReleaseAnnouncement/ReleaseAnnouncement.tsx +++ b/src/components/ReleaseAnnouncement/ReleaseAnnouncement.tsx @@ -17,6 +17,7 @@ limitations under the License. import React, { cloneElement, isValidElement, + JSX, PropsWithChildren, Ref, } from "react"; @@ -60,7 +61,7 @@ export function ReleaseAnnouncement({ children, placement = "right", ...props -}: PropsWithChildren) { +}: PropsWithChildren): JSX.Element { const context = useReleaseAnnouncement({ placement, ...props }); return ( @@ -79,7 +80,9 @@ export function ReleaseAnnouncement({ * @param children - should be a single valid React element * @constructor */ -function ReleaseAnnouncementAnchor({ children }: Readonly) { +function ReleaseAnnouncementAnchor({ + children, +}: Readonly): JSX.Element { const context = useReleaseAnnouncementContext(); // The children can have a ref and we don't want to discard it @@ -108,7 +111,9 @@ function ReleaseAnnouncementAnchor({ children }: Readonly) { * Manage focus and positioning of the children. * @param children */ -function ReleaseAnnouncementContainer({ children }: PropsWithChildren) { +function ReleaseAnnouncementContainer({ + children, +}: PropsWithChildren): JSX.Element | null { const { context: floatingContext, arrowRef, @@ -151,7 +156,7 @@ function ReleaseAnnouncementContainer({ children }: PropsWithChildren) { * - Description can be on multiple lines ------------- - * --------------------------------------------------------------- */ -function ReleaseAnnouncementContent() { +function ReleaseAnnouncementContent(): JSX.Element { const { labelId, descriptionId, header, description, closeLabel, onClick } = useReleaseAnnouncementContext();