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 ,
@@ -104,7 +103,7 @@ const onlyMeaningfulChildren = (children: ReactNode): boolean =>
104103 children !== '' ;
105104
106105const filterProps = (
107- originalProps : Record < string , any > ,
106+ originalProps : Record < string , unknown > ,
108107 cb : ( propsValue : any , propsName : string ) => boolean
109108) : Record < string , any > => {
110109 const filteredProps : Record < string , any > = { } ;
@@ -137,6 +136,7 @@ const parseReactElement = (
137136 }
138137
139138 const displayName = displayNameFn ( element ) ;
139+ // @ts -expect-error: flow to TS
140140 const props = filterProps ( element . props , noChildren ) ;
141141
142142 const key = element . key ;
@@ -148,9 +148,11 @@ const parseReactElement = (
148148
149149 // @ts -expect-error: flow to TS
150150 const defaultProps = filterProps ( element . type . defaultProps || { } , noChildren ) ;
151+ // @ts -expect-error: flow to TS
151152 const children = React . Children . toArray ( element . props . children )
152153 . filter ( onlyMeaningfulChildren )
153- . map ( ( child : ReactElement < any > ) => parseReactElement ( child , options ) ) ;
154+ // @ts -expect-error: flow to TS
155+ . map ( ( child : ReactNode ) => parseReactElement ( child , options ) ) ;
154156
155157 if ( supportFragment && element . type === Fragment ) {
156158 return createReactFragmentTreeNode ( key , children ) ;
0 commit comments