react-and-redux icon indicating copy to clipboard operation
react-and-redux copied to clipboard

《深入浅出React和Redux》代码

Results 64 react-and-redux issues
Sort by recently updated
recently updated
newest added

![image](https://user-images.githubusercontent.com/87635318/127129008-a821b931-37dc-4572-ae20-40f2fcd8a20e.png) ...mapDispatchToProps(store.dispatch,this.props) 每次渲染都会产生新的函数,老师你不是这种情况要避免吗?

reducer 目录包含所有Redux的reducer; 应该为 reducers 目录包好所有Redux的reducer; 还望确认并且修改,感谢!

在 redux_basic, redux_smart_dumb, redux_with_context 实现 componentWillUnmount 时都用了 ``` componentWillUnmount() { this.context.store.unsubscribe(this.onChange); } ``` Redux store 没有 unsubscribe 这个 api,但是由于 这个几个例子中 componentWillUnmount 永远不会被调用,所以构建和运行时并不会报错。

204页讲到的TransitionGroup要发挥作用必须自身已经完成装载 todoList的render函数: > { todos.map((item) => ( )) } 那么TransitionGroup完成装载(componentDidMount)的时候,todoItem肯定已经先于此方法被装载了,而之后该组件才完成装载,这与书上说的完全装载才能发挥作用,不是矛盾了么? 我自己在todoItem里面实现了205页所说的在todoItem里面使用的情况发现也是会有动画的,render函数如下: ` do something ` 望老师解答

``` class Sample extends React.Component { constructor(props) { super(props); this.state = { foo: "’bar " }; } }); Sample.defaultProps = { return { sampleProp: 0 } }; ``` 报错 正确:...

2017年4月第1版第1次印刷 原书中 第三章 48页倒数第五行错误 > 假如有调用者通过Counter.**_addChangeListner_** 应改为:假如有调用者通过Counter.addChangeListener

TypeError: Cannot read property 'string' of undefined (anonymous function) D:/Java/workspace-neon/suibian-manger-react/src/Counter.js:49 46 | } 47 | 48 | Counter.propTypes = { > 49 | caption: PropTypes.string.isRequired, 50 | initValue: PropTypes.number, 51...