Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
dounan
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
1.
▲
Optimizing React Rendering – Mutation Detection with ES6 Proxy
(flexport.engineering)
2 points
by
dounan
9y ago
|
0 comments
2.
▲
Optimizing React Rendering (Part 2) – Mutation Sentinel
(flexport.engineering)
2 points
by
dounan
9y ago
|
0 comments
3.
▲
by
dounan
9y ago
You're right. I misinterpreted your first comment to refer be referring to React elements, which is quite different from DOM elements https://facebook.github.io/react/blog/2015/12/18/react-compo
4.
▲
by
dounan
9y ago
> Correct me if I'm missing anything! You're not missing anything :) That approach also works. The important point is that you have to pass the extra index prop down to the child to avoid the bind in render.
5.
▲
by
dounan
9y ago
That's a great point, and being aware of the dangers of shouldComponentUpdate is what this post is all about. There are a lot of gotchas when using PureComponents, and can lead to bugs if you're not careful. Also, recalculating de
6.
▲
by
dounan
9y ago
I've updated the post to say 'in the right places' instead of 'everywhere' until we get some profiling data.
7.
▲
by
dounan
9y ago
In our experience, React is not necessarily 'slow' by default. Re-constructing parts of the element tree each time can be a bit wasteful, but it is only as slow as your render() methods, and that is outside of React's control
8.
▲
by
dounan
9y ago
First off, thanks for your work on React! Makes all of our lives easier as developers :) As dmnd pointed out, I'm not entirely convinced that dropping PureComponent everywhere is not a good idea. For our app specifically, we unfortunat
9.
▲
by
dounan
9y ago
For this specific example you don't have access to the list index in the constructor. In general binding like that in the constructor works only if you depend on props, but at that point, there isn't a need to bind at all since yo
10.
▲
by
dounan
9y ago
Atom editor with the 'One Dark' theme
11.
▲
by
dounan
9y ago
nit: new component instance (not element)
12.
▲
by
dounan
9y ago
> I guess they just call that function from within the Data component with the correct parameter. Yep > Is there a better way? We're experimenting with some other options internally. Once we have a better sense of what works best
13.
▲
by
dounan
9y ago
The reason arrow functions and bind don't play well with PureComponents is that they return a new function instance each time. This means that the Data pure component will wastefully re-render even if none of the other props change.
14.
▲
by
dounan
9y ago
Haven't tried this myself, but this might be what you're looking for: https://github.com/facebook/react-native/issues/9146#issueco...
15.
▲
Optimizing React Rendering
(flexport.engineering)
128 points
by
dounan
9y ago
|
77 comments
16.
▲
by
dounan
14y ago
Even though you picked the final designer as the winner, how did he know you were actually going to pay him?