From 32c8f29ca55428653e07383af79117e3e8feece4 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 28 Aug 2024 18:30:14 +0800 Subject: [PATCH 1/2] fix: react warnings --- src/DropdownMenu.tsx | 6 +++++- src/Mentions.tsx | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/DropdownMenu.tsx b/src/DropdownMenu.tsx index 637070d..1052f7d 100644 --- a/src/DropdownMenu.tsx +++ b/src/DropdownMenu.tsx @@ -52,7 +52,11 @@ function DropdownMenu(props: DropdownMenuProps) { ); })} - {!options.length && {notFoundContent}} + {!options.length && ( + + {notFoundContent} + + )} ); } diff --git a/src/Mentions.tsx b/src/Mentions.tsx index dbde5bc..e0ee6ea 100644 --- a/src/Mentions.tsx +++ b/src/Mentions.tsx @@ -126,6 +126,9 @@ const InternalMentions = forwardRef( rows = 1, + // Fix Warning: Received `false` for a non-boolean attribute `visible`. + // https://github.com/ant-design/ant-design/blob/df933e94efc8f376003bbdc658d64b64a0e53495/components/mentions/demo/render-panel.tsx + visible, // Rest ...restProps } = props; From b054b88e8bc6ff5f0c7f67d0c56980ca4c4ca07b Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 28 Aug 2024 18:34:15 +0800 Subject: [PATCH 2/2] fix: react warnings --- src/DropdownMenu.tsx | 6 +----- src/Mentions.tsx | 1 + 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/DropdownMenu.tsx b/src/DropdownMenu.tsx index 1052f7d..637070d 100644 --- a/src/DropdownMenu.tsx +++ b/src/DropdownMenu.tsx @@ -52,11 +52,7 @@ function DropdownMenu(props: DropdownMenuProps) { ); })} - {!options.length && ( - - {notFoundContent} - - )} + {!options.length && {notFoundContent}} ); } diff --git a/src/Mentions.tsx b/src/Mentions.tsx index e0ee6ea..24f5b8e 100644 --- a/src/Mentions.tsx +++ b/src/Mentions.tsx @@ -128,6 +128,7 @@ const InternalMentions = forwardRef( // Fix Warning: Received `false` for a non-boolean attribute `visible`. // https://github.com/ant-design/ant-design/blob/df933e94efc8f376003bbdc658d64b64a0e53495/components/mentions/demo/render-panel.tsx + // @ts-expect-error visible, // Rest ...restProps