mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): more memoization
This commit is contained in:
committed by
Kent Keirsey
parent
3e6173ee8c
commit
2d96c62fdb
@ -5,10 +5,10 @@ import type { InvLabelProps } from 'common/components/InvControl/types';
|
||||
import { InvSwitch } from 'common/components/InvSwitch/wrapper';
|
||||
import { setHrfEnabled } from 'features/hrf/store/hrfSlice';
|
||||
import type { ChangeEvent } from 'react';
|
||||
import { useCallback } from 'react';
|
||||
import { memo, useCallback } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
export default function ParamHrfToggle() {
|
||||
const ParamHrfToggle = () => {
|
||||
const dispatch = useAppDispatch();
|
||||
const { t } = useTranslation();
|
||||
|
||||
@ -21,14 +21,12 @@ export default function ParamHrfToggle() {
|
||||
);
|
||||
|
||||
return (
|
||||
<InvControl
|
||||
label={t('hrf.enableHrf')}
|
||||
labelProps={labelProps}
|
||||
w="full"
|
||||
>
|
||||
<InvControl label={t('hrf.enableHrf')} labelProps={labelProps} w="full">
|
||||
<InvSwitch isChecked={hrfEnabled} onChange={handleHrfEnabled} />
|
||||
</InvControl>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
const labelProps: InvLabelProps = { flexGrow: 1 };
|
||||
const labelProps: InvLabelProps = { flexGrow: 1 };
|
||||
|
||||
export default memo(ParamHrfToggle);
|
||||
|
Reference in New Issue
Block a user