mirror of
https://github.com/ershisan99/DevToysWeb.git
synced 2026-01-30 20:52:08 +00:00
chore: upgrade to react 19 beta and next 14 canary
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { PropsWithChildren } from "react";
|
||||
import { Metadata } from "next";
|
||||
|
||||
import { toolGroups } from "@/config/tools";
|
||||
@@ -12,6 +13,6 @@ export const metadata: Metadata = {
|
||||
},
|
||||
};
|
||||
|
||||
export default function Layout({ children }: { children: React.ReactNode }) {
|
||||
export default function Layout({ children }: PropsWithChildren) {
|
||||
return children;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { useCallback, useState } from "react";
|
||||
import { useState } from "react";
|
||||
|
||||
import { toolGroups } from "@/config/tools";
|
||||
import { safeDecodeURIComponent, safeEncodeURIComponent } from "@/lib/uri";
|
||||
@@ -16,26 +16,26 @@ export default function Page() {
|
||||
encoded: "%3E%20It's%20%22URL%20encoding%22%3F",
|
||||
});
|
||||
|
||||
const setFormByDecoded = useCallback((text: string) => {
|
||||
const setFormByDecoded = (text: string) => {
|
||||
setForm({
|
||||
decoded: text,
|
||||
encoded: safeEncodeURIComponent(text).unwrapOr(""),
|
||||
});
|
||||
}, []);
|
||||
};
|
||||
|
||||
const setFormByEncoded = useCallback((text: string) => {
|
||||
const setFormByEncoded = (text: string) => {
|
||||
setForm({
|
||||
decoded: safeDecodeURIComponent(text).unwrapOr(""),
|
||||
encoded: text,
|
||||
});
|
||||
}, []);
|
||||
};
|
||||
|
||||
const clearBoth = useCallback(() => {
|
||||
const clearBoth = () => {
|
||||
setForm({
|
||||
decoded: "",
|
||||
encoded: "",
|
||||
});
|
||||
}, []);
|
||||
};
|
||||
|
||||
const onDecodedChange: TextareaProps["onChange"] = e => setFormByDecoded(e.currentTarget.value);
|
||||
const onEncodedChange: TextareaProps["onChange"] = e => setFormByEncoded(e.currentTarget.value);
|
||||
|
||||
Reference in New Issue
Block a user