Removed one more useMemo
This commit is contained in:
parent
b5b2dd07ee
commit
35fdc7af14
|
@ -43,14 +43,10 @@ const Chronicle = ({ chronicle, chapters, ...otherProps }: Props): JSX.Element =
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
|
|
||||||
const primaryContent = useMemo<
|
const primaryContent = chronicle.contents
|
||||||
NonNullable<ChronicleWithTranslations["contents"]>["data"][number]["attributes"]
|
? filterHasAttributes(chronicle.contents.data, ["attributes.translations"] as const)[0]
|
||||||
>(
|
?.attributes
|
||||||
() =>
|
: undefined;
|
||||||
filterHasAttributes(chronicle.contents?.data, ["attributes.translations"] as const)[0]
|
|
||||||
?.attributes,
|
|
||||||
[chronicle.contents?.data]
|
|
||||||
);
|
|
||||||
|
|
||||||
const [selectedContentTranslation, ContentLanguageSwitcher, ContentLanguageSwitcherProps] =
|
const [selectedContentTranslation, ContentLanguageSwitcher, ContentLanguageSwitcherProps] =
|
||||||
useSmartLanguage({
|
useSmartLanguage({
|
||||||
|
|
Loading…
Reference in New Issue