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
3 & 4 are bad for performance because you do extra work on each render.
3 creates a new function each time and 4 does the binding on each render.
Personally I think # 2 is not so elegant, so number one wins even though I like this decorator https://github.com/andreypopp/autobind-decorator which gives you the overview of where the context is bound directly on the method. If you have a large class, you don't need to scroll up to the constructor and check. Often you don't even need the constructor.
Is this a bug report?
No
Have you read the Contributing Guidelines?
Yes
Environment
Packages: (wanted => installed)
react-native: ^0.49.2 => 0.49.5
react: ^16.0.0-beta.5 => 16.0.0
Target Platform: Android (6.0)
Hi,
Goal is best performance. Which of below script result is better in performance (this is the
renderItem
PureComponent of a largeFlatList
):1:
2:
3:
4:
5:
Your script...
The text was updated successfully, but these errors were encountered: