import React from 'react' ; import ReactDOM from 'react-dom' ; import { History } from 'history' ; import App from './App' ; ( window as any ) . renderFoo = ( containerId , history ) => { ReactDOM . render ( < React . StrictMode > < App history = { history } / > < /React.StrictMode>, document.getElementById(containerId)); } ; ( window as any ) . unmountFoo = ( containerId ) => { ReactDOM . unmountComponentAtNode ( document . getElementById ( containerId ) as any ) ; } ; if ( ! document . getElementById ( 'Foo-container' ) ) { ReactDOM . render ( < React . StrictMode > < App /> < /React.StrictMode>, document.getElementById('root')); }