Optimize rendering

This commit is contained in:
Fedor Indutny 2021-08-11 09:23:21 -07:00 committed by GitHub
parent 81f06e2404
commit 12c78c742f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 702 additions and 444 deletions

View file

@ -8,6 +8,7 @@ import memoizee from 'memoizee';
import { mapDispatchToProps } from '../actions';
import {
PropsActionsType as TimelineActionsType,
ContactSpoofingReviewPropType,
Timeline,
WarningType as TimelineWarningType,
@ -44,13 +45,6 @@ import {
} from '../../util/groupMemberNameCollisions';
import { ContactSpoofingType } from '../../util/contactSpoofing';
// Workaround: A react component's required properties are filtering up through connect()
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/31363
/* eslint-disable @typescript-eslint/no-explicit-any */
const FilteredSmartTimelineItem = SmartTimelineItem as any;
const FilteredSmartTypingBubble = SmartTypingBubble as any;
/* eslint-enable @typescript-eslint/no-explicit-any */
type ExternalProps = {
id: string;
@ -72,10 +66,10 @@ function renderItem(
messageId: string,
conversationId: string,
onHeightChange: (messageId: string) => unknown,
actionProps: Record<string, unknown>
actionProps: TimelineActionsType
): JSX.Element {
return (
<FilteredSmartTimelineItem
<SmartTimelineItem
{...actionProps}
conversationId={conversationId}
id={messageId}
@ -109,7 +103,7 @@ function renderLoadingRow(id: string): JSX.Element {
return <SmartTimelineLoadingRow id={id} />;
}
function renderTypingBubble(id: string): JSX.Element {
return <FilteredSmartTypingBubble id={id} />;
return <SmartTypingBubble id={id} />;
}
const getWarning = (