lazyLoad
路由组件的懒加载
// 将组件引入改为使用lazy引入
import {lazy,Suspense} from 'react'
// import Topics from './Topics'
const Topics = lazy(()=>{import('./Topics')})
//修改注册路由,使用Suspense包裹
<Suspense fallback={<h1>Loading</h1>}>
<Route path="/topics" component={Topics}/>
</Suspense>