@@ -33,19 +33,15 @@ interface PortalNodeBase<C extends Component<any>> {
33
33
// latest placeholder we replaced. This avoids some race conditions.
34
34
unmount ( expectedPlaceholder ?: Node ) : void ;
35
35
}
36
- export interface HtmlBlockPortalNode < C extends Component < any > = Component < any > > extends PortalNodeBase < C > {
36
+ export interface HtmlPortalNode < C extends Component < any > = Component < any > > extends PortalNodeBase < C > {
37
37
element : HTMLElement ;
38
- elementType : typeof ELEMENT_TYPE_HTML_BLOCK ;
39
- }
40
- export interface HtmlInlinePortalNode < C extends Component < any > = Component < any > > extends PortalNodeBase < C > {
41
- element : HTMLElement ;
42
- elementType : typeof ELEMENT_TYPE_HTML_INLINE ;
38
+ elementType : typeof ELEMENT_TYPE_HTML_BLOCK | typeof ELEMENT_TYPE_HTML_INLINE ;
43
39
}
44
40
export interface SvgPortalNode < C extends Component < any > = Component < any > > extends PortalNodeBase < C > {
45
41
element : SVGElement ;
46
42
elementType : typeof ELEMENT_TYPE_SVG ;
47
43
}
48
- type AnyPortalNode < C extends Component < any > = Component < any > > = HtmlBlockPortalNode < C > | HtmlInlinePortalNode < C > | SvgPortalNode < C > ;
44
+ type AnyPortalNode < C extends Component < any > = Component < any > > = HtmlPortalNode < C > | SvgPortalNode < C > ;
49
45
50
46
51
47
const validateElementType = ( domElement : Element , elementType : ANY_ELEMENT_TYPE ) => {
@@ -257,9 +253,9 @@ class OutPortal<C extends Component<any>> extends React.PureComponent<OutPortalP
257
253
}
258
254
259
255
const createHtmlPortalNode = createPortalNode . bind ( null , ELEMENT_TYPE_HTML_BLOCK ) as
260
- < C extends Component < any > = Component < any > > ( options ?: Options ) => HtmlBlockPortalNode < C > ;
256
+ < C extends Component < any > = Component < any > > ( options ?: Options ) => HtmlPortalNode < C > ;
261
257
const createHtmlInlinePortalNode = createPortalNode . bind ( null , ELEMENT_TYPE_HTML_INLINE ) as
262
- < C extends Component < any > = Component < any > > ( options ?: Options ) => HtmlInlinePortalNode < C > ;
258
+ < C extends Component < any > = Component < any > > ( options ?: Options ) => HtmlPortalNode < C > ;
263
259
const createSvgPortalNode = createPortalNode . bind ( null , ELEMENT_TYPE_SVG ) as
264
260
< C extends Component < any > = Component < any > > ( options ?: Options ) => SvgPortalNode < C > ;
265
261
0 commit comments