React Suspense All In One_React React Suspense All In One React.Suspense React.lazy



React Suspense All In One

React Suspense All In One_React

挂起让组件在渲染之前“等待”某些东西。

如今,Suspense仅支持一种用例:使用React.lazy动态加载组件。

将来,它将支持其他用例,例如数据获取。

​https://reactjs.org/docs/react-api.html#suspense​

​https://reactjs.org/docs/code-splitting.html#reactlazy​

React.Suspense

挂起



React.lazy

懒加载



React API

UMD + ESM

React Suspense All In One_用例_03