upgrade react 19, remove preact usage

This commit is contained in:
2024-12-27 15:43:48 +08:00
parent 4b36debd0b
commit 48ead03629
14 changed files with 43 additions and 43 deletions

View File

@@ -1,13 +1,7 @@
import { themeChange } from "theme-change";
import { createRef } from "preact";
import {
StateUpdater,
useContext,
useEffect,
useState,
Dispatch,
} from "preact/hooks";
import { useRef } from "react";
import { useContext, useEffect, useState, Dispatch } from "react";
import { clearTotalCost, getTotalCost } from "@/utils/totalCost";
import {
ChatStore,
@@ -484,7 +478,7 @@ const Choice = (props: {
export default (props: {
chatStore: ChatStore;
setChatStore: (cs: ChatStore) => void;
setShow: Dispatch<StateUpdater<boolean>>;
setShow: Dispatch<boolean>;
selectedChatStoreIndex: number;
templates: TemplateChatStore[];
setTemplates: (templates: TemplateChatStore[]) => void;
@@ -515,7 +509,7 @@ export default (props: {
link = link + `&dev=true`;
}
const importFileRef = createRef();
const importFileRef = useRef<any>(null);
const [totalCost, setTotalCost] = useState(getTotalCost());
// @ts-ignore
const { langCode, setLangCode } = useContext(langCodeContext);