import React from 'react' ; import 'child-replace-with-polyfill' ; import createRef from 'react-create-ref' ; export class ReactDomChild extends React . Component { ref = createRef < HTMLDivElement > ( ) ; componentDidMount ( ) { const childNodes = this . props . children as Node [ ] ; this . ref . current . replaceWith ( ... childNodes ) ; } render ( ) { return < div ref = { this . ref } />; } }