是否可以从组件外部触发Redux操作?
为了从Reactcomponent您的范围之外进行调度和采取行动,您需要获取商店实例并dispatch像这样调用它
Reactcomponent
dispatch
import { store } from '/path/to/createdStore'; ? function testAction(text) { return { type: 'TEST_ACTION', text } } ? store.dispatch(testAction('StackOverflow))
你尚未登录,登录后可以
和开发者交流问题的细节
关注并接收问题和回答的更新提醒
参与内容的编辑和改进,让解决方法与时俱进
联系我
602392714
清零编程群