Accessing the store without @connect-ing?
See original GitHub issueIs there currently a way for a component to access the root Provider store without being connect
-ed to it? It sounds like it might be a bit of an anti-pattern, but I’m not sure. I’ve a couple of circumstances where I can see it coming in handy (dumb components which can still query related data from prop).
Issue Analytics
- State:
- Created 8 years ago
- Comments:29 (15 by maintainers)
Top Results From Across the Web
react-redux: how do you access the store from 'anywhere ...
In the react-redux documentation it states that when using React-redux and connect() importing the store is not recommended.
Read more >Accessing the Store | React Redux
Accessing the Store. React Redux provides APIs that allow your components to dispatch actions and subscribe to data updates from the store.
Read more >If you can't connect to the App Store, iTunes Store, or other ...
Learn what to do if you see a "Cannot connect" message, if an app won't load anything, or if content stops downloading.
Read more >Access the Redux Store Outside a React Component
It's simple to get access to the store inside a React component – no need to pass the store as a prop or...
Read more >Configure access to Microsoft Store (Windows 10)
AppLocker provides policy-based access control management for applications. You can block access to Microsoft Store app with AppLocker by ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
Top Related Hashnode Post
No results found
Top GitHub Comments
If you really really need
store
, grab it from context likeconnect()
does it.Ok, here is the code. I am just pasting the relevant parts (ommitted lots of import calls). Thanks for looking into this @gaearon
app.js (look at the OrderContainer component)
order-container.jsx
Feel free to critique anything that you see wrong/unusual 😃