Re-rendering improvements for like/unlike (#2180)
* Add a few memos * Memo PostDropdownBtn better * More memo * More granularity * Extract PostContent * Fix a usage I missed * oops
This commit is contained in:
parent
a5e25a7a16
commit
5c701f8e0b
7 changed files with 160 additions and 87 deletions
|
@ -1,4 +1,4 @@
|
|||
import React, {useCallback} from 'react'
|
||||
import React, {memo, useCallback} from 'react'
|
||||
import {StyleProp, StyleSheet, TouchableOpacity, ViewStyle} from 'react-native'
|
||||
import {RepostIcon} from 'lib/icons'
|
||||
import {s, colors} from 'lib/styles'
|
||||
|
@ -17,13 +17,13 @@ interface Props {
|
|||
onQuote: () => void
|
||||
}
|
||||
|
||||
export const RepostButton = ({
|
||||
let RepostButton = ({
|
||||
isReposted,
|
||||
repostCount,
|
||||
big,
|
||||
onRepost,
|
||||
onQuote,
|
||||
}: Props) => {
|
||||
}: Props): React.ReactNode => {
|
||||
const theme = useTheme()
|
||||
const {openModal} = useModalControls()
|
||||
const requireAuth = useRequireAuth()
|
||||
|
@ -80,6 +80,8 @@ export const RepostButton = ({
|
|||
</TouchableOpacity>
|
||||
)
|
||||
}
|
||||
RepostButton = memo(RepostButton)
|
||||
export {RepostButton}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
control: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue