refactor: memoize icons on export

This commit is contained in:
rusconn
2023-06-24 09:26:37 +09:00
parent 257080b00d
commit 240fba0e74
14 changed files with 74 additions and 101 deletions

View File

@@ -41,12 +41,10 @@ export default function Page() {
const onJsonChange: EditorProps["onChange"] = value => setInput(value ?? "");
const indentationIcon = useMemo(() => <icons.Space size={24} className="-translate-y-1.5" />, []);
const indentationConfig = useMemo(
() => (
<Configuration
icon={indentationIcon}
icon={<icons.Space size={24} className="-translate-y-1.5" />}
title="Indentation"
control={
<Select value={indentation} onValueChange={setIndentation}>
@@ -66,7 +64,7 @@ export default function Page() {
}
/>
),
[indentation, indentationIcon]
[indentation]
);
const inputPasteButton = useMemo(() => <PasteButton onClipboardRead={setInput} />, []);