3 ms·
There’s a risk that people will start using context everywhere as a minor convenience. This is the reason the React devs kept the original API so obscure. I tr
by underwater 8y ago
There’s a risk that people will start using context everywhere as a minor convenience. This is the reason the React devs kept the original API so obscure.
I try and limit context to the things that are used across the app, but are not coupled to a given component. For example the user’s session, environment specific behaviour, or theme information.
- WalterSear 8y agoI just use it for actions, I have to confess :) Most of the time I feel that global-ish data like that shouldn't be passed/exist in the first place. Context is a doubly dangerous place for it, since it can go stale. I take that back. I'm am accessing this kind of data - via the actions I'm passing down. They are `getStore`ing anything they need. Anything else that needs to have the data >should< access via props, or the redux store is no longer the single point of truth. Footguns, footguns, everywhere. And us, with four left feet.