2020年4月28日

react-hook

摘要: 1.memo 用于优化方法 const Foo=memo((props)=>{ return <div>{props.person.age}</div> }) 2.useState const [count,setCount]=useState(()=>{ return PaymentRespons 阅读全文

posted @ 2020-04-28 14:44 秃了头也不退休 阅读(206) 评论(0) 推荐(0) 编辑

react lazy和suspense

摘要: 代码拆分 Webpack-Code Splitting import import('./detail.js').then(...) import React, { Component,lazy,Suspense } from 'react'; const About = lazy(()=>impo 阅读全文

posted @ 2020-04-28 14:09 秃了头也不退休 阅读(226) 评论(0) 推荐(0) 编辑

react-context 和contextType

摘要: import React, { Component,createContext } from 'react'; const OnLineContext=createContext() //可以传入默认值 const BatteryContext=createContext(90) class Mid 阅读全文

posted @ 2020-04-28 11:34 秃了头也不退休 阅读(392) 评论(0) 推荐(0) 编辑

导航