Skip to content

Commit c6f4ad7

Browse files
committed
fix: check logic
1 parent 5145d99 commit c6f4ad7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/utils/warningPropsUtil.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ function warningProps(props: SelectProps) {
104104
if (children) {
105105
let invalidateChildType = null;
106106
toNodeArray(children).some((node: React.ReactNode) => {
107-
if (!React.isValidElement(node)) {
107+
if (!React.isValidElement(node) || !node.type) {
108108
return false;
109109
}
110110

@@ -118,6 +118,7 @@ function warningProps(props: SelectProps) {
118118
(subNode: React.ReactElement) => {
119119
if (
120120
!React.isValidElement(subNode) ||
121+
!node.type ||
121122
(subNode.type as { isSelectOption?: boolean }).isSelectOption
122123
) {
123124
return true;

0 commit comments

Comments
 (0)