![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
React
deryabuder
一只菜鸡
展开
-
React遇到的坑
1. 列表渲染问题:(1)调用map函数要提供默认值 (2)箭头函数函数体不能加{} (3)列表元素要提供key属性const numbers = [1, 2, 3, 4, 5];const listItems = (numbers || []).map((number, index) => <li key={index}&g...原创 2019-01-04 15:57:08 · 498 阅读 · 0 评论 -
react-router3与react-router4之间的不同
(1)插件的选择(3选择react-router,4选择react-router-dom)react-router 为 React Router 提供核心路由功能,但是你不需要直接安装 react-router;如果你写浏览器端应用,你应该安装 react-router-dom;如果你写 React Native 应用,你应该安装 react-router-native;当你安装 rea...原创 2018-12-29 17:55:45 · 984 阅读 · 0 评论 -
今天开始学习React,todo-list的实现、项目初始化、react-redux的使用
class Todo extends React.Component { constructor(props) { super(props) this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this) this.state = { list:...原创 2018-12-29 11:26:32 · 146 阅读 · 0 评论