摘要: Renders the first child <Route> or <Redirect> that matches the location. If the URL is /about, then <About>, <User>, and <NoMatch> will all render bec 阅读全文
posted @ 2021-08-24 11:54 Redchar 阅读(159) 评论(0) 推荐(0) 编辑
摘要: mobx-react中Provider和inject通过context将store注入并使得任何层级的子组件可以访问到store 创建store后在根组件通过Provider组件注入 // App.jsx import React from "react"; import { render } fr 阅读全文
posted @ 2021-08-24 11:20 Redchar 阅读(443) 评论(0) 推荐(0) 编辑
摘要: React.lazy() 允许你定义一个动态加载的组件。这有助于缩减 bundle 的体积,并延迟加载在初次渲染时未用到的组件。 渲染 lazy 组件依赖该组件渲染树上层的 <React.Suspense> 组件。 React.Suspense 可以指定加载指示器(loading indicator 阅读全文
posted @ 2021-08-24 11:13 Redchar 阅读(76) 评论(0) 推荐(0) 编辑