我在 helpers.js
中公开了一组辅助函数,有没有办法可以让helpers.js中的所有函数都知道redux存储?
我通常理解,如果它在类Component中,我可以使用export default connect(mapStateToProps)(ComponentName),以便状态映射到我的props .
我也试图避免从 redux.store
直接访问或全局暴露商店 .
这不是答案导出存储的React Redux - accessing existing store in a helper function解决方案的重复,我无法控制它 .
谢谢你的帮助 .