mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
feat(ui): memoize all components
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Flex, Image, Text } from '@chakra-ui/react';
|
||||
import InvokeAILogoImage from 'assets/images/logo.png';
|
||||
import { AnimatePresence, motion } from 'framer-motion';
|
||||
import { useRef } from 'react';
|
||||
import { memo, useRef } from 'react';
|
||||
import { useHoverDirty } from 'react-use';
|
||||
import { useGetAppVersionQuery } from 'services/api/endpoints/appInfo';
|
||||
|
||||
@@ -66,4 +66,4 @@ const InvokeAILogoComponent = ({ showVersion = true }: Props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default InvokeAILogoComponent;
|
||||
export default memo(InvokeAILogoComponent);
|
||||
|
||||
@@ -39,6 +39,7 @@ import {
|
||||
ChangeEvent,
|
||||
ReactElement,
|
||||
cloneElement,
|
||||
memo,
|
||||
useCallback,
|
||||
useEffect,
|
||||
} from 'react';
|
||||
@@ -398,4 +399,4 @@ const SettingsModal = ({ children, config }: SettingsModalProps) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default SettingsModal;
|
||||
export default memo(SettingsModal);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Flex } from '@chakra-ui/react';
|
||||
import { PropsWithChildren } from 'react';
|
||||
import { PropsWithChildren, memo } from 'react';
|
||||
|
||||
const StyledFlex = (props: PropsWithChildren) => {
|
||||
return (
|
||||
@@ -20,4 +20,4 @@ const StyledFlex = (props: PropsWithChildren) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default StyledFlex;
|
||||
export default memo(StyledFlex);
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useAppSelector } from 'app/store/storeHooks';
|
||||
import { defaultSelectorOptions } from 'app/store/util/defaultMemoizeOptions';
|
||||
import { AnimatePresence, motion } from 'framer-motion';
|
||||
import { ResourceKey } from 'i18next';
|
||||
import { useMemo, useRef } from 'react';
|
||||
import { memo, useMemo, useRef } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { FaCircle } from 'react-icons/fa';
|
||||
import { useHoverDirty } from 'react-use';
|
||||
@@ -125,4 +125,4 @@ const StatusIndicator = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export default StatusIndicator;
|
||||
export default memo(StatusIndicator);
|
||||
|
||||
Reference in New Issue
Block a user