3 ms·
The two biggest problems with React: 1. Updates are O(N), where N is the size of your virtual dom tree. 2. You have to manually keep track of dependencies wit
by amelius 11y ago
The two biggest problems with React:
1. Updates are O(N), where N is the size of your virtual dom tree.
2. You have to manually keep track of dependencies within your code, in order to trigger updates.
- timdorr 11y agoReact doesn't have to be O(N). You can short circuit rendering with shouldComponentUpdate checks.
- grayrest 11y agoshouldComponentUpdate only prunes the size of the vdom tree, updates are still O(n_virtual_dom). I've always thought this was an advantage compared to alternative approaches I know about since pruning the size of the vdom tends to be fairly easy compared to, say, optimizing a KVO chain.
- aidenn0 11y ago#1 is true out-of-the-box, but there are many ways to fix that. #2 is flat out not true unless you decide to ignore all of the documentation and have your render function depend on something other than the state and properties of your component.