param text returns import React , { ComponentClass , ReactElement } from 'react' ; import ReactDOM from 'react-dom' ; param text returns export function transformStringIntoASingleLine ( text ) { return text . replace ( /[\n\r\t]|\s{2,}/g , '' ) ; } /**
 * Holder for the return value of  renderClassComponent .
  interface RenderAPI < SomeComponent extends ComponentClass > { /** The instance of the rendered component, where all the methods are accessible. */ instance : InstanceType < SomeComponent > ; /** The HTML node that the component has been rendered to. */ root : HTMLElement ; } param component returns export function renderClassComponent < SomeComponent extends ComponentClass > ( component ) { const ComponentToRender = component as any ; const instance = React . createRef < InstanceType < SomeComponent > > ( ) ; const root = document . createElement ( 'div' ) ; ReactDOM . render ( < ComponentToRender ref = { instance } / > , root ) ; return { instance : instance . current as InstanceType < SomeComponent > , root } ; } param node returns export function renderReactNode ( node ) { const root = document . createElement ( 'div' ) ; ReactDOM . render ( node , root ) ; return root ; }