Add some memoization (#1947)

This commit is contained in:
dan 2023-11-17 02:52:41 +00:00 committed by GitHub
parent e358c3cc30
commit a10adf8908
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 12 deletions

View file

@ -1,4 +1,4 @@
import React from 'react'
import React, {memo} from 'react'
import {
StyleSheet,
TouchableOpacity,
@ -105,12 +105,12 @@ interface LoadedProps {
isProfilePreview?: boolean
}
function ProfileHeaderLoaded({
let ProfileHeaderLoaded = ({
profile,
moderation,
hideBackButton = false,
isProfilePreview,
}: LoadedProps) {
}: LoadedProps): React.ReactNode => {
const pal = usePalette('default')
const palInverted = usePalette('inverted')
const {currentAccount} = useSession()
@ -627,6 +627,7 @@ function ProfileHeaderLoaded({
</View>
)
}
ProfileHeaderLoaded = memo(ProfileHeaderLoaded)
const styles = StyleSheet.create({
banner: {