mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-08 19:22:44 +08:00
Revert "Refactor components to remove forwardRef and simplify props handling"
This reverts commit 1cd013fb94.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { TextField } from "@mui/material";
|
||||
import { useLockFn } from "ahooks";
|
||||
import { nanoid } from "nanoid";
|
||||
import { useImperativeHandle, useState } from "react";
|
||||
import { forwardRef, useImperativeHandle, useState } from "react";
|
||||
import { useForm, Controller } from "react-hook-form";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
@@ -19,10 +19,7 @@ export interface TestViewerRef {
|
||||
}
|
||||
|
||||
// create or edit the test item
|
||||
export const TestViewer = ({
|
||||
ref,
|
||||
...props
|
||||
}: Props & { ref?: React.RefObject<TestViewerRef | null> }) => {
|
||||
export const TestViewer = forwardRef<TestViewerRef, Props>((props, ref) => {
|
||||
const { t } = useTranslation();
|
||||
const [open, setOpen] = useState(false);
|
||||
const [openType, setOpenType] = useState<"new" | "edit">("new");
|
||||
@@ -176,4 +173,4 @@ export const TestViewer = ({
|
||||
/>
|
||||
</BaseDialog>
|
||||
);
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user