Webpack在npm项目中如何实现懒加载?
Component A
;
}
// src/components/ComponentB.js
export default function ComponentB() {
return Component B
;
}
// src/App.js
import React, { Suspense, lazy } from 'react';
import './App.css';
const ComponentA = lazy(() => import('./components/ComponentA'));
const ComponentB = lazy(() => import('./components/ComponentB'));
function App() {
return (
猜你喜欢:零侵扰可观测性