While debugging, can I have access to the Redux store from the browser console?

前端 未结 9 1243
难免孤独
难免孤独 2020-12-12 14:01

I have unit tests for my reducers. However, when I\'m debugging in the browser, I want to check if my actions have been called correctly and whether the state h

9条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-12 15:01

    With react developer tools:

    const store = [...__REACT_DEVTOOLS_GLOBAL_HOOK__.reactDevtoolsAgent.internalInstancesById.values()].find(e=>e.elementType.name==="Provider").pendingProps.store
    

提交回复
热议问题