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
I read some articles on React Props and State and get confused about that.
props should not be modified if I didn't misunderstand props and state...
when using react.backbone, the model was passing in a component via props, and the model definitely will change, right? is that proper to update the component this way?
sorry if this question is too silly...
The text was updated successfully, but these errors were encountered:
The props don't change, but their contents can change. So you pass a user. The user doesn't change, but his avatar_url might. In general the philosophy of backbone is a bit different from the philosophy of react, so in 'pure' react you indeed wouldn't do this, but pass in only a dumb object (like model.attributes)
@markijbema thanks for your comment. one interesting thing that i've found is that another plugin called backbone-react-component seems use the state to hold the model data. so maybe that's just two different ways. anyhow, they both work.
I read some articles on React Props and State and get confused about that.
props should not be modified if I didn't misunderstand props and state...
when using react.backbone, the model was passing in a component via props, and the model definitely will change, right? is that proper to update the component this way?
sorry if this question is too silly...
The text was updated successfully, but these errors were encountered: