1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Clean up react memo

This commit is contained in:
Zhiyuan Zheng
2022-04-30 21:47:17 +02:00
parent f93d6f7db8
commit 293447f65c
8 changed files with 93 additions and 82 deletions

View File

@ -5,10 +5,10 @@ import { useTranslation } from 'react-i18next'
import { useSelector } from 'react-redux'
export interface Props {
status: Pick<Mastodon.Status, 'content' | 'spoiler_text' | 'emojis'> & {
mentions?: Mastodon.Status['mentions']
tags?: Mastodon.Status['tags']
}
status: Pick<
Mastodon.Status,
'content' | 'spoiler_text' | 'emojis' | 'mentions' | 'tags'
>
numberOfLines?: number
highlighted?: boolean
disableDetails?: boolean
@ -72,7 +72,9 @@ const TimelineContent = React.memo(
</>
)
},
(prev, next) => prev.status.content === next.status.content
(prev, next) =>
prev.status.content === next.status.content &&
prev.status.spoiler_text === next.status.spoiler_text
)
export default TimelineContent