-
Notifications
You must be signed in to change notification settings - Fork 0
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
Question about getModel() #1
Comments
I think this answers my question: http://stackoverflow.com/questions/21709905/can-i-avoid-forceupdate-when-using-react-with-backbone. |
You can always call setModel directly (this method is exposed using the "modelAware" mixin. This will basically force-set whatever model you choose. Additionally, you can choose to override the getModel method. This can be done because all of these mixins use react-mixin-manager
|
Thanks! |
If I try to call |
ok I'll take a look at that. thanks |
in that case I suppose that it does make sense to pull it from state so I can set it within the state if the setModel method is used. I actually put that method there but have never had the need to use it |
0.9.2 has just been release which should resolve this problem (state is now used when setModel is called) Also, you can use props.model or props.collection when associating a model with a component (if not using setModel) |
https://github.com/jhudson8/backbone-reaction/blob/master/backbone-reaction.js#L819
This is dependent on the model being sent to the form as a prop, but what about cases where the model is a property in the state?
For example, I have one form where the model changes depending on which item you select. Then I
setState
on the form component whenever a new item is selected. I'm trying to figure out if this is a use-case that you're just not supporting, or maybe there is a better way I can do this.The text was updated successfully, but these errors were encountered: