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:
committed by
Kent Keirsey
parent
ca4b8e65c1
commit
56527da73e
@@ -5,10 +5,10 @@ import type { InvSelectOnChange } from 'common/components/InvSelect/types';
|
||||
import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus';
|
||||
import { languageChanged } from 'features/system/store/systemSlice';
|
||||
import { isLanguage } from 'features/system/store/types';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
import { memo, useCallback, useMemo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
export const SettingsLanguageSelect = () => {
|
||||
export const SettingsLanguageSelect = memo(() => {
|
||||
const { t } = useTranslation();
|
||||
const dispatch = useAppDispatch();
|
||||
const language = useAppSelector((state) => state.system.language);
|
||||
@@ -58,4 +58,6 @@ export const SettingsLanguageSelect = () => {
|
||||
<InvSelect value={value} options={options} onChange={onChange} />
|
||||
</InvControl>
|
||||
);
|
||||
};
|
||||
});
|
||||
|
||||
SettingsLanguageSelect.displayName = 'SettingsLanguageSelect';
|
||||
|
||||
@@ -4,10 +4,10 @@ import { InvControl } from 'common/components/InvControl/InvControl';
|
||||
import { InvSelect } from 'common/components/InvSelect/InvSelect';
|
||||
import type { InvSelectOnChange } from 'common/components/InvSelect/types';
|
||||
import { consoleLogLevelChanged } from 'features/system/store/systemSlice';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
import { memo, useCallback, useMemo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
export const SettingsLogLevelSelect = () => {
|
||||
export const SettingsLogLevelSelect = memo(() => {
|
||||
const { t } = useTranslation();
|
||||
const dispatch = useAppDispatch();
|
||||
const consoleLogLevel = useAppSelector(
|
||||
@@ -43,4 +43,6 @@ export const SettingsLogLevelSelect = () => {
|
||||
<InvSelect value={value} options={options} onChange={onChange} />
|
||||
</InvControl>
|
||||
);
|
||||
};
|
||||
});
|
||||
|
||||
SettingsLogLevelSelect.displayName = 'SettingsLogLevelSelect';
|
||||
|
||||
Reference in New Issue
Block a user