Skip to content

Commit

Permalink
Merge pull request #155 from element-hq/florianduros/fix-release-anno…
Browse files Browse the repository at this point in the history
…uncement-react-17

Fix release announcement for react 17
  • Loading branch information
florianduros authored Apr 4, 2024
2 parents 5b913e7 + 71a49c3 commit 40d22a5
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/components/ReleaseAnnouncement/ReleaseAnnouncement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
import React, {
cloneElement,
isValidElement,
JSX,
PropsWithChildren,
Ref,
} from "react";
Expand Down Expand Up @@ -60,7 +61,7 @@ export function ReleaseAnnouncement({
children,
placement = "right",
...props
}: PropsWithChildren<ReleaseAnnouncementProps>) {
}: PropsWithChildren<ReleaseAnnouncementProps>): JSX.Element {
const context = useReleaseAnnouncement({ placement, ...props });

return (
Expand All @@ -79,7 +80,9 @@ export function ReleaseAnnouncement({
* @param children - should be a single valid React element
* @constructor
*/
function ReleaseAnnouncementAnchor({ children }: Readonly<PropsWithChildren>) {
function ReleaseAnnouncementAnchor({
children,
}: Readonly<PropsWithChildren>): JSX.Element {
const context = useReleaseAnnouncementContext();

// The children can have a ref and we don't want to discard it
Expand Down Expand Up @@ -108,7 +111,9 @@ function ReleaseAnnouncementAnchor({ children }: Readonly<PropsWithChildren>) {
* Manage focus and positioning of the children.
* @param children
*/
function ReleaseAnnouncementContainer({ children }: PropsWithChildren) {
function ReleaseAnnouncementContainer({
children,
}: PropsWithChildren): JSX.Element | null {
const {
context: floatingContext,
arrowRef,
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 40d22a5

Please sign in to comment.