Skip to content

Latest commit

 

History

History
8 lines (5 loc) · 860 Bytes

sagabiji.md

File metadata and controls

8 lines (5 loc) · 860 Bytes

connected react router不需要安装history,自己安装可能导致不兼容。核心是,创建这个router中间件的时候,传入history对象,自己定义了两个action,在dispatch的时候拦截,然后调用history的api

saga里tabke的actionType跟reducer是两种,saga里take的actiontype,是给组件dispatch用的,(reducer里没有处理这种actionType)saga中间件拦截到这个actiontype,
再next啥的,然后把参数传给那个actiontype对应的generator函数!

react-router-dom里有依赖2个库,history,react-router,为了功能明确,dom是在dom里用的路由包,还有移动端的啥的。

Route的component、render、children区别:component只要匹配了,就显示,render可以在匹配后,自己附加控制时候显示该组件,children就是不论匹配与否,都显示