perf!: reduce the bundle size of /encoders-decoders/html

BREAKING CHANGE: ' -> '
This commit is contained in:
rusconn
2023-06-15 17:33:15 +09:00
parent 497991f133
commit 6612a3be2d
3 changed files with 18 additions and 10 deletions

View File

@@ -1,7 +1,7 @@
"use client";
import { useCallback, useMemo, useState } from "react";
import { decode, encode } from "html-entities";
import { escape, unescape } from "html-escaper";
import { toolGroups } from "@/config/tools";
import { Textarea, TextareaProps } from "@/components/ui/textarea";
@@ -16,20 +16,20 @@ import { PageSection } from "@/components/page-section";
export default function Page() {
const [form, setForm] = useState({
decoded: '> It\'s "HTML escaping".',
encoded: "> It's "HTML escaping".",
encoded: "> It's "HTML escaping".",
});
const setDecodedReactively = useCallback((text: string) => {
setForm({
decoded: text,
encoded: encode(text),
encoded: escape(text),
});
}, []);
const setEncodedReactively = useCallback((text: string) => {
setForm({
encoded: text,
decoded: decode(text),
decoded: unescape(text),
});
}, []);