Skip to content
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

Backbone example: changed key from Math.random() to todo.cid #616

Merged
merged 1 commit into from
Nov 27, 2013

Conversation

davidhellsing
Copy link
Contributor

It doesn’t make much sense to generate a random key for each todo render, because it will re-draw all todo’s DOM nodes on each model change. I changed it to the unique identifier todo.cid already supplied by the backbone model.

It doesn’t make much sense to generate a random key for each todo render, because it will re-draw all todo’s DOM nodes on each model change. I changed it to the unique identifier ``todo.cid`` already supplied by the backbone model.
@sophiebits
Copy link
Contributor

This looks great to me, thanks.

@davidhellsing
Copy link
Contributor Author

It’s actually a very important part of integrating backbone with react, because without this fix all models will be hanged loose on each render.

@petehunt
Copy link
Contributor

Yes this is great. Did you sign the cla? Let me know and I'll merge!

@davidhellsing
Copy link
Contributor Author

@petehunt sorry, signed the what? Nevermind, I found and signed it as David Hellsing.

@zpao
Copy link
Member

zpao commented Nov 27, 2013

@petehunt is gallivanting around the world so I'll merge this in. Thanks a lot!

zpao added a commit that referenced this pull request Nov 27, 2013
Backbone example: changed key from Math.random() to todo.cid
@zpao zpao merged commit e31fdfd into facebook:master Nov 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants