Skip to content

Commit

Permalink
fix: check logic
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed Sep 2, 2019
1 parent 5145d99 commit c6f4ad7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils/warningPropsUtil.ts
Expand Up @@ -104,7 +104,7 @@ function warningProps(props: SelectProps) {
if (children) {
let invalidateChildType = null;
toNodeArray(children).some((node: React.ReactNode) => {
if (!React.isValidElement(node)) {
if (!React.isValidElement(node) || !node.type) {
return false;
}

Expand All @@ -118,6 +118,7 @@ function warningProps(props: SelectProps) {
(subNode: React.ReactElement) => {
if (
!React.isValidElement(subNode) ||
!node.type ||
(subNode.type as { isSelectOption?: boolean }).isSelectOption
) {
return true;
Expand Down

0 comments on commit c6f4ad7

Please sign in to comment.