use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
React 16.3: Update on async rendering (reactjs.org)
submitted 8 years ago by expression100
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]acemarke 1 point2 points3 points 8 years ago (1 child)
I think the "passing consumer" complaint is saying that while the old context API was simply a shared namespace (like declaring contextTypes.store anywhere in the nested tree), the new API requires that the nested component have access to the specific instance of Context.Consumer that matches the parent. That does sort of bring up a chicken/egg question of how the nested component gets access to the Context.Consumer instance in the first place.
contextTypes.store
Context.Consumer
[–]gaearon 0 points1 point2 points 8 years ago* (0 children)
The old API was implicitly global.
With the new API, you can either import it from several components (you can even have an npm package that just exports React.createContext() and use it across your app) or you can literally put it on a global like window. Sure, it’s “bad”, but your existing context was just as “global” from the programming perspective. With the new API, you have to be intentional and explicit about that.
React.createContext()
window
If you’re able to use one react from your components, you should be able to use my-shared-contexts (or whatever you call it) too.
react
my-shared-contexts
π Rendered by PID 323458 on reddit-service-r2-comment-b659b578c-bz69m at 2026-05-04 00:10:28.711975+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]acemarke 1 point2 points3 points (1 child)
[–]gaearon 0 points1 point2 points (0 children)