Skip to content

Commit 8273cf8

Browse files
committed
Pass through generics on create*PortalNode
1 parent 0597299 commit 8273cf8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,10 @@ class OutPortal<C extends Component<any>> extends React.PureComponent<OutPortalP
222222
}
223223
}
224224

225-
const createHtmlPortalNode = createPortalNode.bind(null, ELEMENT_TYPE_HTML) as () => HtmlPortalNode;
226-
const createSvgPortalNode = createPortalNode.bind(null, ELEMENT_TYPE_SVG) as () => SvgPortalNode;
225+
const createHtmlPortalNode = createPortalNode.bind(null, ELEMENT_TYPE_HTML) as
226+
<C extends Component<any> = Component<any>>() => HtmlPortalNode<C>;
227+
const createSvgPortalNode = createPortalNode.bind(null, ELEMENT_TYPE_SVG) as
228+
<C extends Component<any> = Component<any>>() => SvgPortalNode<C>;
227229

228230
export {
229231
createHtmlPortalNode,

0 commit comments

Comments
 (0)