fix feed glitch by memoizing NoteText

This commit is contained in:
Martti Malmi
2024-02-12 12:54:11 +02:00
parent 96947fad2e
commit 512307f42d
2 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,4 @@
import React, { useState } from "react";
import React, { memo, useState } from "react";
import { FormattedMessage } from "react-intl";
import { Link } from "react-router-dom";
@ -9,7 +9,7 @@ import Text from "@/Components/Text/Text";
import useLogin from "@/Hooks/useLogin";
const TEXT_TRUNCATE_LENGTH = 400;
export const NoteText = function InnerContent(
export const NoteText = memo(function InnerContent(
props: NoteProps & { translated: NoteTranslation; showTranslation?: boolean },
) {
const { data: ev, options, translated, showTranslation } = props;
@ -94,4 +94,4 @@ export const NoteText = function InnerContent(
}
}
return innerContent;
};
});