import React from 'react' ; import ReactDOM from 'react-dom' ; import { I18nProvider } from '@osd/i18n/react' ; import { MountPoint } from 'opensearch-dashboards/public' ; param node export const toMountPoint = ( node ) : MountPoint => { const mount = ( element ) => { ReactDOM . render ( < I18nProvider > { node } < /I18nProvider>, element); return ( ) => ReactDOM . unmountComponentAtNode ( element ) ; } ; if ( process . env . NODE_ENV !== 'production' ) { mount . __reactMount__ = node ; } return mount ; } ;