随笔分类 - react
摘要:###Navigator组件的属性 1.configureScene 该属性指定的回调函数被执行时,会收到一个导航路径参数,开发者可以根据导航路径中的各信息来决定场景切换使用的效果。 可能值: PushFromRight PushFromLeft FloatFromRight FloatFromLe
阅读全文
摘要:###用法 connect([mapStateToProps], [mapDispatchToProps], [mergeProps],[options]) 作用:连接React组件与Redux Store mapStateToProps允许我们将 store 中的数据作为 props 绑定到组件上
阅读全文
摘要:1.babel会将jsx转换为React.creatElement表达式; 2.React.createElement render(){ return element } 在render函数调用时,生成一个element(虚拟节点); 3.众多element组成虚拟dom; 4.ReactDOMC
阅读全文
摘要:通过params 1.路由表中 <Route path=' /sort/:id ' component={Sort}></Route> 2.Link处 HTML方式 <Link to={ ' /sort/ ' + ' 2 ' } activeClassName='active'>XXXX</Link
阅读全文
摘要:##React性能优化 ###性能优化的重点 1.setState之后,组件进行渲染,无论state是否改变; 2.父组件渲染后,子组件跟着渲染; ###hooks之前 class组件 1.class *** extends React.PureComponent 对props进行一次浅比较。局限性
阅读全文