【发布时间】:2018-05-24 20:14:24
【问题描述】:
我有一个 React 页面,它从使用 saga 中间件的 redux 商店加载了一堆东西。
在这个特定页面中,我想加载一些不是通过 props 传入的新内容。
因此,我为上传的个人资料照片的新集合创建了一个新的 reducer、action 和 watcher。
有没有办法加载这个我设置的新集合而不将它作为道具传递?
谢谢! :)
这是我对该页面的反应功能:
export default function profileEdit(props) {
//passed in as props
const { stats, weapons, armor, readOnly } = props;
//not passed in as props
const { profilePics } = ??;
return (
<div></div>
)
【问题讨论】:
-
也许解释一下您为什么要避免使用道具会让我们更好地帮助您。
标签: reactjs react-redux redux-saga