Reputation: 507
I'm using react-redux with the components. It passes dispatch as a prop into my top level component, but i'm having trouble accessing it from deeply nested (and some other more complexly mounted) components. What is the best way to access dispatch from any component? Do I need to pass it manually as a prop to every component I'd like to use it in?
Upvotes: 0
Views: 651
Reputation: 976
If you don't want to use connect
everywhere around you can just explicitly import store and dispatch on it: http://redux.js.org/docs/basics/Store.html
Upvotes: 0
Reputation: 15325
You can use connect
on components even if they are bellow some already connected components.
Upvotes: 2