Last active
September 28, 2023 11:00
-
-
Save cristiangu/c5e0567e9f4734519c6249bce3112670 to your computer and use it in GitHub Desktop.
Optimising React Native's View render speed
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
import React from 'react'; | |
import { View } from './view'; | |
const MyScreen = () => { | |
return Array.from(Array(5000).keys()).map((i) => (<View key={i} />)); | |
} |
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
import React from 'react'; | |
import { View } from 'react-native'; | |
const MyScreen = () => { | |
return Array.from(Array(5000).keys()).map((i) => (<View key={i} />)); | |
} |
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
export const View = require('react-native/Libraries/Components/View/ViewNativeComponent').default; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment