You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given that React can and is being used for server-side rendering, and that in a server context stores and dispatchers really need a context-based registry, and that components need to be able to pull context-based instances, not just a global/static instance, it would be extremely useful to be able to specify a global property of React that is a list of properties that are automatically passed from parent to child if not specified.
ex:
//app.js - loads app.jsx
var React = require('React');
React.addInheritingProperty('context');
//app.jsx
render: function() {
<App context={instance}>
<Child>will have context for the instance</Child>
</App>
}
This would apply to rendering of {children} as well as specified controls rendered within a parent. Right now, for example, using Yahoo's fluxible-app you need to explicitely pass context to all children that will use the router and store mixins for the purpose of using stores and the router components.
By making such a functionality available, instance registries for stores/dispatchers would be far easier to utilize. They could simply specify a base property to use (ex _my_store_registry_) and simply use that against rendered instances.
The text was updated successfully, but these errors were encountered:
@gaearon@zpao thanks.. the actual reason for the request is I'm currently using yahoo's flux tooling so I can pre-render server-side and client-side... I noticed I had to pass context from the outer to child nodes in order for child nodes to request a given StoreMixin ...
Given that React can and is being used for server-side rendering, and that in a server context stores and dispatchers really need a context-based registry, and that components need to be able to pull context-based instances, not just a global/static instance, it would be extremely useful to be able to specify a global property of
React
that is a list of properties that are automatically passed from parent to child if not specified.ex:
This would apply to rendering of {children} as well as specified controls rendered within a parent. Right now, for example, using Yahoo's fluxible-app you need to explicitely pass context to all children that will use the router and store mixins for the purpose of using stores and the router components.
By making such a functionality available, instance registries for stores/dispatchers would be far easier to utilize. They could simply specify a base property to use (ex
_my_store_registry_
) and simply use that against rendered instances.The text was updated successfully, but these errors were encountered: