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
{{ message }}
This repository was archived by the owner on May 15, 2019. It is now read-only.
Repository navigation
This repository was archived by the owner on May 15, 2019. It is now read-only.
If the backbone-mixin is deprecated, then what are you using in it's place? I'm not sure if this is part of what was abandoned, but I'm wondering in the example why the Backbone model is a prop instead of in the state? Doesn't that force you to have to setProps on the parent and forceUpdate on the component?
The backbone mixin is deprecated for essentially the reason you mention - any change on the model causes a forceUpdate on the component.
Internally we do have a version that uses state. It requires a bit more configuration because you have to tell it how to update state when the model changes, but I think that tradeoff is well worth it. I don't think it's gotten much use since we're gradually moving away from backbone backing our views to simple objects / flux.
I'll leave this open until I add a note about this.
Activity
joelburget commentedon Sep 22, 2014
The backbone mixin is deprecated for essentially the reason you mention - any change on the model causes a
forceUpdateon the component.Internally we do have a version that uses state. It requires a bit more configuration because you have to tell it how to update state when the model changes, but I think that tradeoff is well worth it. I don't think it's gotten much use since we're gradually moving away from backbone backing our views to simple objects / flux.
I'll leave this open until I add a note about this.
gaearon commentedon Oct 15, 2014
This is the mixin we used (until we transitioned to Flux as well):
Components define
watchBackboneProps(props, listenTo),getBackboneState(props), optionallyhaveBackbonePropsChanged(nextProps).