为了从
Reactcomponent您的范围之外进行调度和采取行动,您需要获取商店实例并
dispatch像这样调用它
import { store } from '/path/to/createdStore';function testAction(text) { return { type: 'TEST_ACTION', text }}store.dispatch(testAction('StackOverflow))
为了从
Reactcomponent您的范围之外进行调度和采取行动,您需要获取商店实例并
dispatch像这样调用它
import { store } from '/path/to/createdStore';function testAction(text) { return { type: 'TEST_ACTION', text }}store.dispatch(testAction('StackOverflow))