mirror of
https://github.com/ershisan99/DevToysWeb.git
synced 2025-12-17 20:49:24 +00:00
refactor: memoize icons on export
This commit is contained in:
@@ -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} />, []);
|
||||
|
||||
Reference in New Issue
Block a user