Martin Dluhy
Martin Dluhy

Reputation: 143

Debugging "react-redux" application?

I need to debug "react-redux" application and find out which part of code is dispatching exact action for redux, because it should not.

If I use "Redux DevTools" and debugger in chrome or external , when there is breakpoint set "Redux DevTools" are not working anymore until all breakpoints are completed , then I can see actions in it.

However I need to find out which part of code is calling dispatch as it is probably somewhere from external library

Upvotes: 2

Views: 2325

Answers (1)

Simon Boudrias
Simon Boudrias

Reputation: 44619

If you set a breakpoint inside the action creator function, you'll see where it is being created.

Also, by default dispatch is synchronous, so unless you override the default behavior, setting a breakpoint inside your reducer will also allow you to inspect the full stack and see where an action has been triggered.

Upvotes: 3

Related Questions