javascript - 从 Redux 传递 props
问题描述
如何在不从父组件传递 props 的情况下从 redux 调用 props。
...
<Component name={name}/>
...
我想props.something()
在这里使用
const Component = (name) => {
//how to call props here?
//ex : props.something()
}
export default connect(mapStateToProps,mapDispatchToProps)(Component)
解决方案
推荐阅读
- html - 如何将标签与 CSS 中 div 的“BOTTOM”对齐?
- react-native - 我如何在本机反应中设置选择器的样式
- iis - OPTIONS/200OK 之后的下一步
- pandas - 熊猫数据框添加新列并将现有列方向更改为索引
- php - 使用查询字符串重定向 URL?
- c++ - 基本的 c++ 问题:如果我在函数中创建一些东西并返回它会发生什么?
- haskell - Haskell 将 Integer 转换为 Int
- android - 如何将一个视图设置在另一个视图之上?
- django - 使用 Django Rest 框架过滤层次数据的 URL 列表
- jquery - 在 AJAX 中发送数据而不连接字符串