import React , { Component , ComponentProps } from 'react' ; import ReactDOM from 'react-dom' ; import hljs from 'highlight.js' ; import javascript from 'highlight.js/lib/languages/javascript' ; import 'highlight.js/styles/atom-one-light.css' ; import fundebug from 'fundebug-javascript' ; import Provider from '@store/index' ; import App from '@views/App' ; import './styles/icon.scss' ; hljs . registerLanguage ( 'javascript' , javascript ) ; fundebug . init ( { apikey : 'bea8b252e67404b2b6118505f81015811ec957841a06a0919fa54e0a58b49cfb' } ) ; class ErrorBoundary extends Component < ComponentProps < any > , { hasError : boolean ; } > { constructor ( props ) { super ( props ) ; this . state = { hasError : false } ; } componentDidCatch ( error , info ) { this . setState ( { hasError : true } ) ; fundebug . notifyError ( error , { metaData : { info } } ) ; } render ( ) { if ( this . state . hasError ) { return null ; } return this . props . children ; } } const render = ( ) => { ReactDOM . render ( < ErrorBoundary > < Provider > < App /> < /Provider> < /ErrorBoundary>, document.querySelector('#app')); } ; render ( ) ;