1- import type { ReactElement , ReactNode } from 'react' ;
2- import React , { Fragment } from 'react' ;
1+ import React , { Fragment , ReactElement , ReactNode } from 'react' ;
32import {
43 ForwardRef ,
54 isContextConsumer ,
@@ -106,7 +105,7 @@ const onlyMeaningfulChildren = (children: ReactNode): boolean =>
106105 children !== '' ;
107106
108107const filterProps = (
109- originalProps : Record < string , any > ,
108+ originalProps : Record < string , unknown > ,
110109 cb : ( propsValue : any , propsName : string ) => boolean
111110) : Record < string , any > => {
112111 const filteredProps : Record < string , any > = { } ;
@@ -139,6 +138,7 @@ const parseReactElement = (
139138 }
140139
141140 const displayName = displayNameFn ( element ) ;
141+ // @ts -expect-error: flow to TS
142142 const props = filterProps ( element . props , noChildren ) ;
143143
144144 // @ts -expect-error: flow to TS
@@ -156,9 +156,11 @@ const parseReactElement = (
156156
157157 // @ts -expect-error: flow to TS
158158 const defaultProps = filterProps ( element . type . defaultProps || { } , noChildren ) ;
159+ // @ts -expect-error: flow to TS
159160 const children = React . Children . toArray ( element . props . children )
160161 . filter ( onlyMeaningfulChildren )
161- . map ( ( child : ReactElement < any > ) => parseReactElement ( child , options ) ) ;
162+ // @ts -expect-error: flow to TS
163+ . map ( ( child : ReactNode ) => parseReactElement ( child , options ) ) ;
162164
163165 if ( supportFragment && element . type === Fragment ) {
164166 return createReactFragmentTreeNode ( key , children ) ;
0 commit comments