raect项目代码中看到植入redux数据有
export default connect(
mapStateToProps,
mapDispatchToProps
)(Counter);
还有是这种方式的
@connect(mapStateToProps,
mapDispatchToProps)
不知道这两种方式的区别在哪里?度娘上面也很少搜到@这种类型的
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
装饰器,一种语法糖。
这个回答很好你可以看下 http://stackoverflow.com/ques...
Decorators