标签:rom const tde pac state import ack chunk ons
import React, {Component,lazy, Suspense} from ‘react‘ const About = lazy(() => import(/*webpackChunkName: ‘about‘*/‘./child.jsx‘)) class Layout extends Component { state = { error: false } static getDerivedStateFromError () { return { error: true } } render () { if (this.state.error) { return <div>error</div> } return ( <div> home <Suspense fallback={<div>加载中</div>}> <About /> </Suspense> </div> ) } }
标签:rom const tde pac state import ack chunk ons
原文地址:https://www.cnblogs.com/zhangrenjie/p/14592759.html