昔書いたものなので情報が古いかも
対策
Try to use React Native's FlatList/SectionList/VirtualizedList where you can and not array.map() as it allows for asynchronous rendering of components in your viewport which is important for mobile devices.
- FlatList/SectionList/VirtualizedListを使う
- shouldComponentUpdateかPureComponentを使用する
- React Navigation使わない
- initialNumToRenderを設定する
- renderItemにはステートレスコンポーネントを指定する
- 1つのコンポーネントに複数のFlatList/SectionList/VirtualizedListを使わない
- ScrollView内でFlatListをラップしない
- 先にAndroidを開発する
- リリースビルドで確認する
- console.xxxを削除する(babel-plugin-transform-remove-console)
- JavaScriptコードを減らす(ネイティブコードを増やす)
1. FlatList/SectionList/VirtualizedListを使う
リストなどでは、データをArray.map()して描画するのではなく、FlatList/SectionList/VirtualizedListを使う。
2. shouldComponentUpdateかPureComponentを使用する
Reactの性質上、あるコンポーネントが子コンポーネントが更新されると、子コンポーネントも更新されます。shouldComponentUpdateを定義することで、コンポーネントの更新を制御できます。また、そもそも厳密な更新が必要ない場合はPureComponentを使うと、変化がないと判定されたComponentはUpdateされにくいため、パフォーマンスが向上します。