Created
May 21, 2018 06:58
-
-
Save teimurjan/0ad6f6662516a0a6ba7cc48fc819fd83 to your computer and use it in GitHub Desktop.
blog-react-applications-optimization
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You have this 4 components | |
const elements = [ | |
{ type: "div", key: 0, textContent: "Container #0" }, | |
{ type: "div", key: 1, textContent: "Container #1" }, | |
{ type: "div", key: 2, textContent: "Container #2" }, | |
{ type: "div", key: 3, textContent: "Container #3" } | |
]; | |
// Delete Container #1 | |
const elements = [ | |
{ type: "div", key: 0, textContent: "Container #0" }, | |
// Components with text Container #2 and Container #3 has new indexes | |
{ type: "div", key: 1, textContent: "Container #2" }, | |
{ type: "div", key: 2, textContent: "Container #3" } | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment