New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bootstrap function supports passing in custom context, but does not support adding the required childContextTypes declaration #67
Comments
There is a |
@robertfw, with current React approach to context, you need to define a wrapper component with |
@kapooostin thanks, I missed that. @Tvaroh from what I see/understand, for context.bootstrap to accept additional context via I am trying a different approach with Morearty sitting behind a flux store (I am using Fluxxor, specifically), so for now this isn't an issue for me, but I wonder if others might run into this. |
@robertfw, previously, Morearty was using now deprecated React's |
Hello everyone, @robertfw since the issue is not closed yet, would it be possible to also add support for additional props to the elements ? bootstrap: function (rootComp, reactContext, reactContextTypes, reactProps) {
...
return React.createClass({
...
render: function () {
var rootProps = reactProps || {};
rootProps.bindind = ctx.getBinding();
return React.createFactory(rootComp)(rootProps);
}
});
} I read few thing about context, but I think that this simple use would also be interesting. Yet, I'm still new at React. |
@Kineolyan, as an alternative you can wrap your root component into another component and pass all required props right there. Does it solve your use case? |
Hello @Tvaroh, yes I updated the bootstrap method to include properties updates inside but I think I ended up with issues. |
Hi @Tvaroh, yes, it is also possible to wrap the root into another component, having the proper properties. I was "polluting" this open issue to also offer my little improvement. |
@Kineolyan, no problems, your input is absolutely welcome! :) |
Trying something like...
Will result in:
I am currently just making my own bootstrap, but a simple fix would probably look something like:
I forked and was going to send in a PR but couldn't figure out how to build the project to test the change.
The text was updated successfully, but these errors were encountered: